Skip to content

Commit

Permalink
Merge tag 'for-v3.11' of git://git.infradead.org/battery-2.6
Browse files Browse the repository at this point in the history
Pull battery subsystem update from Anton Vorontsov:
 "Nothing exciting this time, just assorted fixes and cleanups"

* tag 'for-v3.11' of git://git.infradead.org/battery-2.6: (25 commits)
  charger-manager: Fix regulator_get() return check
  charger-manager: Fix a bug when it unregisters notifier block of extcon
  tps65090-charger: Add dt node to power_supply
  sbs-battery: Add dt to power_supply struct
  power_supply: Add of_node_put to fix refcount
  power_supply: Move of_node out of the #ifdef CONFIG_OF
  power/reset: Make the vexpress driver optional on arm and arm64
  charger-manager: Add missing newlines, fix a couple of typos, add pr_fmt
  tps65090-charger: Fix AC detect
  MAINTAINERS: Update email address for Anton Vorontsov
  charger-manager: Ensure event is not used as format string
  power_supply: Replace strict_strtoul() with kstrtoul()
  generic-adc-battery: Fix checking if none of the channels are supported
  power: Use platform_{get,set}_drvdata()
  pm2301_charger: Return error if create_singlethread_workqueue fails
  pm2301_charger: Fix NULL pointer dereference
  lp8727_charger: Support the device tree feature
  twl4030_charger: Remove unnecessary platform_set_drvdata()
  rx51_battery: Remove unnecessary platform_set_drvdata()
  jz4740-battery: Remove unnecessary platform_set_drvdata()
  ...
  • Loading branch information
torvalds committed Jul 10, 2013
2 parents 3aa78e0 + 5a6c220 commit 7d3107d
Show file tree
Hide file tree
Showing 24 changed files with 241 additions and 130 deletions.
44 changes: 44 additions & 0 deletions Documentation/devicetree/bindings/power_supply/lp8727_charger.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Binding for TI/National Semiconductor LP8727 Charger

Required properties:
- compatible: "ti,lp8727"
- reg: I2C slave address 27h

Optional properties:
- interrupt-parent: interrupt controller node (see interrupt binding[0])
- interrupts: interrupt specifier (see interrupt binding[0])
- debounce-ms: interrupt debounce time. (u32)

AC and USB charging parameters
- charger-type: "ac" or "usb" (string)
- eoc-level: value of 'enum lp8727_eoc_level' (u8)
- charging-current: value of 'enum lp8727_ichg' (u8)

[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt

Example)

lp8727@27 {
compatible = "ti,lp8727";
reg = <0x27>;

/* GPIO 134 is used for LP8728 interrupt pin */
interrupt-parent = <&gpio5>; /* base = 128 */
interrupts = <6 0x2>; /* offset = 6, falling edge type */

debounce-ms = <300>;

/* AC charger: 5% EOC and 500mA charging current */
ac {
charger-type = "ac";
eoc-level = /bits/ 8 <0>;
charging-current = /bits/ 8 <4>;
};

/* USB charger: 10% EOC and 400mA charging current */
usb {
charger-type = "usb";
eoc-level = /bits/ 8 <1>;
charging-current = /bits/ 8 <2>;
};
};
8 changes: 4 additions & 4 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ S: Maintained
F: arch/arm/mach-highbank/

ARM/CAVIUM NETWORKS CNS3XXX MACHINE SUPPORT
M: Anton Vorontsov <[email protected]>
M: Anton Vorontsov <[email protected]>
S: Maintained
F: arch/arm/mach-cns3xxx/
T: git git://git.infradead.org/users/cbou/linux-cns3xxx.git
Expand Down Expand Up @@ -6406,7 +6406,7 @@ F: include/linux/timer*
F: kernel/*timer*

POWER SUPPLY CLASS/SUBSYSTEM and DRIVERS
M: Anton Vorontsov <[email protected]>
M: Anton Vorontsov <[email protected]>
M: David Woodhouse <[email protected]>
T: git git://git.infradead.org/battery-2.6.git
S: Maintained
Expand Down Expand Up @@ -6516,7 +6516,7 @@ S: Maintained
F: drivers/block/ps3vram.c

PSTORE FILESYSTEM
M: Anton Vorontsov <[email protected]>
M: Anton Vorontsov <[email protected]>
M: Colin Cross <[email protected]>
M: Kees Cook <[email protected]>
M: Tony Luck <[email protected]>
Expand Down Expand Up @@ -7214,7 +7214,7 @@ F: drivers/mmc/host/sdhci.*
F: drivers/mmc/host/sdhci-pltfm.[ch]

SECURE DIGITAL HOST CONTROLLER INTERFACE, OPEN FIRMWARE BINDINGS (SDHCI-OF)
M: Anton Vorontsov <[email protected]>
M: Anton Vorontsov <[email protected]>
L: [email protected]
L: [email protected]
S: Maintained
Expand Down
1 change: 0 additions & 1 deletion drivers/power/88pm860x_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,6 @@ static int pm860x_battery_remove(struct platform_device *pdev)
free_irq(info->irq_batt, info);
free_irq(info->irq_cc, info);
power_supply_unregister(&info->battery);
platform_set_drvdata(pdev, NULL);
return 0;
}

Expand Down
1 change: 0 additions & 1 deletion drivers/power/88pm860x_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,6 @@ static int pm860x_charger_remove(struct platform_device *pdev)
struct pm860x_charger_info *info = platform_get_drvdata(pdev);
int i;

platform_set_drvdata(pdev, NULL);
power_supply_unregister(&info->usb);
free_irq(info->irq[0], info);
for (i = 0; i < info->irq_nums; i++)
Expand Down
1 change: 0 additions & 1 deletion drivers/power/ab8500_btemp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,6 @@ static int ab8500_btemp_remove(struct platform_device *pdev)

flush_scheduled_work();
power_supply_unregister(&di->btemp_psy);
platform_set_drvdata(pdev, NULL);

return 0;
}
Expand Down
2 changes: 0 additions & 2 deletions drivers/power/ab8500_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -3425,8 +3425,6 @@ static int ab8500_charger_remove(struct platform_device *pdev)
if (di->ac_chg.enabled && !di->ac_chg.external)
power_supply_unregister(&di->ac_chg.psy);

platform_set_drvdata(pdev, NULL);

return 0;
}

Expand Down
7 changes: 3 additions & 4 deletions drivers/power/ab8500_fg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2465,9 +2465,9 @@ static ssize_t charge_full_store(struct ab8500_fg *di, const char *buf,
size_t count)
{
unsigned long charge_full;
ssize_t ret = -EINVAL;
ssize_t ret;

ret = strict_strtoul(buf, 10, &charge_full);
ret = kstrtoul(buf, 10, &charge_full);

dev_dbg(di->dev, "Ret %zd charge_full %lu", ret, charge_full);

Expand All @@ -2489,7 +2489,7 @@ static ssize_t charge_now_store(struct ab8500_fg *di, const char *buf,
unsigned long charge_now;
ssize_t ret;

ret = strict_strtoul(buf, 10, &charge_now);
ret = kstrtoul(buf, 10, &charge_now);

dev_dbg(di->dev, "Ret %zd charge_now %lu was %d",
ret, charge_now, di->bat_cap.prev_mah);
Expand Down Expand Up @@ -3070,7 +3070,6 @@ static int ab8500_fg_remove(struct platform_device *pdev)
flush_scheduled_work();
ab8500_fg_sysfs_psy_remove_attrs(di->fg_psy.dev);
power_supply_unregister(&di->fg_psy);
platform_set_drvdata(pdev, NULL);
return ret;
}

Expand Down
1 change: 0 additions & 1 deletion drivers/power/abx500_chargalg.c
Original file line number Diff line number Diff line change
Expand Up @@ -2035,7 +2035,6 @@ static int abx500_chargalg_remove(struct platform_device *pdev)
destroy_workqueue(di->chargalg_wq);

power_supply_unregister(&di->chargalg_psy);
platform_set_drvdata(pdev, NULL);

return 0;
}
Expand Down
2 changes: 0 additions & 2 deletions drivers/power/bq27x00_battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -966,7 +966,6 @@ static int bq27000_battery_probe(struct platform_device *pdev)
return 0;

err_free:
platform_set_drvdata(pdev, NULL);
kfree(di);

return ret;
Expand All @@ -978,7 +977,6 @@ static int bq27000_battery_remove(struct platform_device *pdev)

bq27x00_powersupply_unregister(di);

platform_set_drvdata(pdev, NULL);
kfree(di);

return 0;
Expand Down
Loading

0 comments on commit 7d3107d

Please sign in to comment.