Browse Source

power supply and reset changes for the v4.9 series

* move power supply drivers to drivers/power/supply
  * unify location of power supply DT documentation
  * tps65217-charger: IRQ support
  * act8945a-charger: misc. cleanups & improvements
  * sbs-battery cleanup
  * fix users of deprecated create_singlethread_workqueue()
  * misc fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iQIcBAABCgAGBQJX8j3bAAoJENju1/PIO/qavlcP/Rq5LeMol2KYQfYOLrVKmS9N
 sqJpOM1wnQS25Dw+KQf+bNOLuBY/w44SnINFYswV2Vw5DQ2ODt1IzvqoaPBwznpq
 BeLN/NLvYY2vIAPxmHxvdB0mnPEhRJOgZkHXUkonIqX98qnzbIorQtHBhAZ3h2v6
 nz5ltO3GXiAyzPE6Zhx9OWWTZRLi1YKCuPZstRU6SY6uGwEMyEVMcu6Rv3XFizBj
 kng9nOCWRE3723UaGQx3LumI2EIsJ1m7RDHIx0ZPOIRlUEd5bawhxdhfT1pQAEZS
 y7GSs4FE86QuGN4M+zcxr4u1vSmYsK2c7FGFRnBcwG4Hkmy4O4h1yBjmrMby8eWo
 V0JxsGkkN+R/6/cAKqXRL0T5gU4rKf4LAj84kSOHGZDiQk0D29wGNZuBtlQw/2sB
 CLABJvpn11aQ3NIkNttr1ur8S15C9tAEMKmjrK7bbvtzBUp2BoVguYQtkP909s0U
 19exP0yslM95t0cRT6lCpZUPFUvoEDs7iIDwv7QBFJSB2ZDMUFfGy6ouM6gHnfKL
 ZkiCi2gmhTqHCpGvD/yi8FhuDFBZ7Ujcotzn3bE07GSTeG7FmzhR+6khedq9DIYQ
 xJbDdPwmwhbrOe99O0wk/qFCBcvgmkXaE4O23fBPS10oCs70FFseYFfb15qAljsE
 4ydoaCMwFUgH49SpDQC6
 =HpLI
 -----END PGP SIGNATURE-----

Merge tag 'for-v4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply

Pull power supply and reset updates from Sebastian Reichel:
 - move power supply drivers to drivers/power/supply
 - unify location of power supply DT documentation
 - tps65217-charger: IRQ support
 - act8945a-charger: misc. cleanups & improvements
 - sbs-battery cleanup
 - fix users of deprecated create_singlethread_workqueue()
 - misc fixes.

* tag 'for-v4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (46 commits)
  power: supply: bq27xxx_battery: allow kernel poll_interval parameter runtime update
  power: supply: sbs-battery: Cleanup removal of chip->pdata
  power: reset: st: Remove obsolete platforms from dt doc
  power: reset: st-poweroff: Remove obsolete platforms.
  power: reset: zx-reboot: Unmap region obtained by of_iomap
  power: reset: xgene-reboot: Unmap region obtained by of_iomap
  power: supply: ab8500: cleanup with list_first_entry_or_null()
  power: reset: add in missing white space in error message text
  sbs-battery: make writes to ManufacturerAccess optional
  power: bq24257: Fix use of uninitialized pointer bq->charger
  power: supply: sbs-battery: simplify DT parsing
  power: supply: bq24735-charger: Request status GPIO with initial input setup
  power: supply: sbs-battery: Use gpio_desc and sleeping calls for battery detect
  power: supply: act8945a_charger: Add max current property
  power: supply: act8945a_charger: Add capacity level property
  doc: bindings: power: act8945a-charger: Update properties.
  power: supply: act8945a_charger: Fix the power supply type
  power: supply: act8945a_charger: Add status change update support
  power: supply: act8945a_charger: Improve state handling
  power: supply: act8945a_charger: Remove "battery_temperature"
  ...
master
Linus Torvalds 5 years ago
parent
commit
021723e6c5
  1. 4
      CREDITS
  2. 8
      Documentation/ABI/testing/sysfs-class-power
  3. 35
      Documentation/devicetree/bindings/power/act8945a-charger.txt
  4. 0
      Documentation/devicetree/bindings/power/reset/axxia-reset.txt
  5. 0
      Documentation/devicetree/bindings/power/reset/imx-snvs-poweroff.txt
  6. 0
      Documentation/devicetree/bindings/power/reset/msm-poweroff.txt
  7. 0
      Documentation/devicetree/bindings/power/reset/qnap-poweroff.txt
  8. 0
      Documentation/devicetree/bindings/power/reset/restart-poweroff.txt
  9. 7
      Documentation/devicetree/bindings/power/reset/st-reset.txt
  10. 0
      Documentation/devicetree/bindings/power/supply/ab8500/btemp.txt
  11. 0
      Documentation/devicetree/bindings/power/supply/ab8500/chargalg.txt
  12. 0
      Documentation/devicetree/bindings/power/supply/ab8500/charger.txt
  13. 0
      Documentation/devicetree/bindings/power/supply/ab8500/fg.txt
  14. 48
      Documentation/devicetree/bindings/power/supply/act8945a-charger.txt
  15. 0
      Documentation/devicetree/bindings/power/supply/axp20x_usb_power.txt
  16. 0
      Documentation/devicetree/bindings/power/supply/bq2415x.txt
  17. 0
      Documentation/devicetree/bindings/power/supply/bq24257.txt
  18. 0
      Documentation/devicetree/bindings/power/supply/bq25890.txt
  19. 0
      Documentation/devicetree/bindings/power/supply/charger-manager.txt
  20. 0
      Documentation/devicetree/bindings/power/supply/da9150-charger.txt
  21. 0
      Documentation/devicetree/bindings/power/supply/da9150-fg.txt
  22. 0
      Documentation/devicetree/bindings/power/supply/gpio-charger.txt
  23. 0
      Documentation/devicetree/bindings/power/supply/isp1704.txt
  24. 0
      Documentation/devicetree/bindings/power/supply/lp8727_charger.txt
  25. 0
      Documentation/devicetree/bindings/power/supply/ltc2941.txt
  26. 0
      Documentation/devicetree/bindings/power/supply/max17042_battery.txt
  27. 0
      Documentation/devicetree/bindings/power/supply/max8925_batter.txt
  28. 0
      Documentation/devicetree/bindings/power/supply/olpc_battery.txt
  29. 0
      Documentation/devicetree/bindings/power/supply/power_supply.txt
  30. 0
      Documentation/devicetree/bindings/power/supply/qcom,coincell-charger.txt
  31. 0
      Documentation/devicetree/bindings/power/supply/qcom_smbb.txt
  32. 0
      Documentation/devicetree/bindings/power/supply/rt9455_charger.txt
  33. 0
      Documentation/devicetree/bindings/power/supply/rx51-battery.txt
  34. 0
      Documentation/devicetree/bindings/power/supply/sbs_sbs-battery.txt
  35. 0
      Documentation/devicetree/bindings/power/supply/ti,bq24735.txt
  36. 0
      Documentation/devicetree/bindings/power/supply/tps65090.txt
  37. 0
      Documentation/devicetree/bindings/power/supply/tps65217_charger.txt
  38. 0
      Documentation/devicetree/bindings/power/supply/twl-charger.txt
  39. 4
      Documentation/driver-model/devres.txt
  40. 4
      Documentation/power/power_supply_class.txt
  41. 46
      MAINTAINERS
  42. 518
      drivers/power/Kconfig
  43. 75
      drivers/power/Makefile
  44. 359
      drivers/power/act8945a_charger.c
  45. 2
      drivers/power/reset/keystone-reset.c
  46. 59
      drivers/power/reset/reboot-mode.c
  47. 4
      drivers/power/reset/reboot-mode.h
  48. 41
      drivers/power/reset/st-poweroff.c
  49. 12
      drivers/power/reset/syscon-reboot-mode.c
  50. 4
      drivers/power/reset/xgene-reboot.c
  51. 5
      drivers/power/reset/zx-reboot.c
  52. 0
      drivers/power/supply/88pm860x_battery.c
  53. 0
      drivers/power/supply/88pm860x_charger.c
  54. 514
      drivers/power/supply/Kconfig
  55. 74
      drivers/power/supply/Makefile
  56. 0
      drivers/power/supply/ab8500_bmdata.c
  57. 2
      drivers/power/supply/ab8500_btemp.c
  58. 4
      drivers/power/supply/ab8500_charger.c
  59. 11
      drivers/power/supply/ab8500_fg.c
  60. 4
      drivers/power/supply/abx500_chargalg.c
  61. 666
      drivers/power/supply/act8945a_charger.c
  62. 0
      drivers/power/supply/apm_power.c
  63. 0
      drivers/power/supply/axp20x_usb_power.c
  64. 1
      drivers/power/supply/axp288_charger.c
  65. 1
      drivers/power/supply/axp288_fuel_gauge.c
  66. 0
      drivers/power/supply/bq2415x_charger.c
  67. 0
      drivers/power/supply/bq24190_charger.c
  68. 12
      drivers/power/supply/bq24257_charger.c
  69. 45
      drivers/power/supply/bq24735-charger.c
  70. 0
      drivers/power/supply/bq25890_charger.c
  71. 43
      drivers/power/supply/bq27xxx_battery.c
  72. 0
      drivers/power/supply/bq27xxx_battery_i2c.c
  73. 0
      drivers/power/supply/charger-manager.c
  74. 0
      drivers/power/supply/collie_battery.c
  75. 0
      drivers/power/supply/da9030_battery.c
  76. 0
      drivers/power/supply/da9052-battery.c
  77. 0
      drivers/power/supply/da9150-charger.c
  78. 0
      drivers/power/supply/da9150-fg.c
  79. 7
      drivers/power/supply/ds2760_battery.c
  80. 4
      drivers/power/supply/ds2780_battery.c
  81. 4
      drivers/power/supply/ds2781_battery.c
  82. 0
      drivers/power/supply/ds2782_battery.c
  83. 0
      drivers/power/supply/generic-adc-battery.c
  84. 0
      drivers/power/supply/goldfish_battery.c
  85. 0
      drivers/power/supply/gpio-charger.c
  86. 3
      drivers/power/supply/intel_mid_battery.c
  87. 2
      drivers/power/supply/ipaq_micro_battery.c
  88. 0
      drivers/power/supply/isp1704_charger.c
  89. 0
      drivers/power/supply/jz4740-battery.c
  90. 0
      drivers/power/supply/lp8727_charger.c
  91. 0
      drivers/power/supply/lp8788-charger.c
  92. 0
      drivers/power/supply/ltc2941-battery-gauge.c
  93. 4
      drivers/power/supply/max14577_charger.c
  94. 0
      drivers/power/supply/max17040_battery.c
  95. 0
      drivers/power/supply/max17042_battery.c
  96. 4
      drivers/power/supply/max77693_charger.c
  97. 0
      drivers/power/supply/max8903_charger.c
  98. 0
      drivers/power/supply/max8925_power.c
  99. 0
      drivers/power/supply/max8997_charger.c
  100. 0
      drivers/power/supply/max8998_charger.c

4
CREDITS

@ -1090,6 +1090,10 @@ S: 6350 Stoneridge Mall Road
S: Pleasanton, CA 94588
S: USA
N: Dmitry Eremin-Solenikov
E: dbaryshkov@gmail.com
D: Power Supply Maintainer from v3.14 - v3.15
N: Doug Evans
E: dje@cygnus.com
D: Wrote Xenix FS (part of standard kernel since 0.99.15)

8
Documentation/ABI/testing/sysfs-class-power

@ -22,7 +22,7 @@ Description:
What: /sys/class/power_supply/max14577-charger/device/fast_charge_timer
Date: October 2014
KernelVersion: 3.18.0
Contact: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Contact: Krzysztof Kozlowski <krzk@kernel.org>
Description:
This entry shows and sets the maximum time the max14577
charger operates in fast-charge mode. When the timer expires
@ -36,7 +36,7 @@ Description:
What: /sys/class/power_supply/max77693-charger/device/fast_charge_timer
Date: January 2015
KernelVersion: 3.19.0
Contact: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Contact: Krzysztof Kozlowski <krzk@kernel.org>
Description:
This entry shows and sets the maximum time the max77693
charger operates in fast-charge mode. When the timer expires
@ -50,7 +50,7 @@ Description:
What: /sys/class/power_supply/max77693-charger/device/top_off_threshold_current
Date: January 2015
KernelVersion: 3.19.0
Contact: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Contact: Krzysztof Kozlowski <krzk@kernel.org>
Description:
This entry shows and sets the charging current threshold for
entering top-off charging mode. When charging current in fast
@ -65,7 +65,7 @@ Description:
What: /sys/class/power_supply/max77693-charger/device/top_off_timer
Date: January 2015
KernelVersion: 3.19.0
Contact: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Contact: Krzysztof Kozlowski <krzk@kernel.org>
Description:
This entry shows and sets the maximum time the max77693
charger operates in top-off charge mode. When the timer expires

35
Documentation/devicetree/bindings/power/act8945a-charger.txt

@ -1,35 +0,0 @@
Device-Tree bindings for charger of Active-semi ACT8945A Multi-Function Device
Required properties:
- compatible: "active-semi,act8945a", please refer to ../mfd/act8945a.txt.
- active-semi,chglev-gpios: charge current level phandle with args
as described in ../gpio/gpio.txt.
Optional properties:
- active-semi,check-battery-temperature: boolean to check the battery
temperature or not.
- active-semi,input-voltage-threshold-microvolt: unit: mV;
Specifies the charger's input over-voltage threshold value;
The value can be: 6600, 7000, 7500, 8000; default: 6600
- active-semi,precondition-timeout: unit: minutes;
Specifies the charger's PRECONDITION safety timer setting value;
The value can be: 40, 60, 80, 0; If 0, it means to disable this timer;
default: 40.
- active-semi,total-timeout: unit: hours;
Specifies the charger's total safety timer setting value;
The value can be: 3, 4, 5, 0; If 0, it means to disable this timer;
default: 3.
Example:
pmic@5b {
compatible = "active-semi,act8945a";
reg = <0x5b>;
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_charger_chglev>;
active-semi,chglev-gpios = <&pioA 12 GPIO_ACTIVE_HIGH>;
active-semi,input-voltage-threshold-microvolt = <6600>;
active-semi,precondition-timeout = <40>;
active-semi,total-timeout = <3>;
};

0
Documentation/devicetree/bindings/power_supply/axxia-reset.txt → Documentation/devicetree/bindings/power/reset/axxia-reset.txt

0
Documentation/devicetree/bindings/power_supply/imx-snvs-poweroff.txt → Documentation/devicetree/bindings/power/reset/imx-snvs-poweroff.txt

0
Documentation/devicetree/bindings/power_supply/msm-poweroff.txt → Documentation/devicetree/bindings/power/reset/msm-poweroff.txt

0
Documentation/devicetree/bindings/power_supply/qnap-poweroff.txt → Documentation/devicetree/bindings/power/reset/qnap-poweroff.txt

0
Documentation/devicetree/bindings/power_supply/restart-poweroff.txt → Documentation/devicetree/bindings/power/reset/restart-poweroff.txt

7
Documentation/devicetree/bindings/power/reset/st-reset.txt

@ -1,11 +1,12 @@
*Device-Tree bindings for ST SW reset functionality
Required properties:
- compatible: should be "st,<chip>-restart".
- compatible: should be "stih407-restart".
- st,syscfg: should be a phandle of the syscfg node.
Example node:
restart {
compatible = "st,stih416-restart";
st,syscfg = <&syscfg_sbc>;
compatible = "st,stih407-restart";
st,syscfg = <&syscfg_sbc_reg>;
status = "okay";
};

0
Documentation/devicetree/bindings/power_supply/ab8500/btemp.txt → Documentation/devicetree/bindings/power/supply/ab8500/btemp.txt

0
Documentation/devicetree/bindings/power_supply/ab8500/chargalg.txt → Documentation/devicetree/bindings/power/supply/ab8500/chargalg.txt

0
Documentation/devicetree/bindings/power_supply/ab8500/charger.txt → Documentation/devicetree/bindings/power/supply/ab8500/charger.txt

0
Documentation/devicetree/bindings/power_supply/ab8500/fg.txt → Documentation/devicetree/bindings/power/supply/ab8500/fg.txt

48
Documentation/devicetree/bindings/power/supply/act8945a-charger.txt

@ -0,0 +1,48 @@
Device-Tree bindings for charger of Active-semi ACT8945A Multi-Function Device
Required properties:
- compatible: "active-semi,act8945a-charger".
- active-semi,chglev-gpios: charge current level phandle with args
as described in ../gpio/gpio.txt.
- active-semi,lbo-gpios: specify the low battery voltage detect phandle
with args as as described in ../gpio/gpio.txt.
- interrupts: <a b> where a is the interrupt number and b is a
field that represents an encoding of the sense and level
information for the interrupt.
- interrupt-parent: the phandle for the interrupt controller that
services interrupts for this device.
Optional properties:
- active-semi,input-voltage-threshold-microvolt: unit: mV;
Specifies the charger's input over-voltage threshold value;
The value can be: 6600, 7000, 7500, 8000; default: 6600
- active-semi,precondition-timeout: unit: minutes;
Specifies the charger's PRECONDITION safety timer setting value;
The value can be: 40, 60, 80, 0; If 0, it means to disable this timer;
default: 40.
- active-semi,total-timeout: unit: hours;
Specifies the charger's total safety timer setting value;
The value can be: 3, 4, 5, 0; If 0, it means to disable this timer;
default: 3.
Example:
pmic@5b {
compatible = "active-semi,act8945a";
reg = <0x5b>;
status = "okay";
charger {
compatible = "active-semi,act8945a-charger";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_charger_chglev &pinctrl_charger_lbo &pinctrl_charger_irq>;
interrupt-parent = <&pioA>;
interrupts = <45 GPIO_ACTIVE_LOW>;
active-semi,chglev-gpios = <&pioA 12 GPIO_ACTIVE_HIGH>;
active-semi,lbo-gpios = <&pioA 72 GPIO_ACTIVE_LOW>;
active-semi,input-voltage-threshold-microvolt = <6600>;
active-semi,precondition-timeout = <40>;
active-semi,total-timeout = <3>;
status = "okay";
};
};

0
Documentation/devicetree/bindings/power_supply/axp20x_usb_power.txt → Documentation/devicetree/bindings/power/supply/axp20x_usb_power.txt

0
Documentation/devicetree/bindings/power/bq2415x.txt → Documentation/devicetree/bindings/power/supply/bq2415x.txt

0
Documentation/devicetree/bindings/power/bq24257.txt → Documentation/devicetree/bindings/power/supply/bq24257.txt

0
Documentation/devicetree/bindings/power/bq25890.txt → Documentation/devicetree/bindings/power/supply/bq25890.txt

0
Documentation/devicetree/bindings/power_supply/charger-manager.txt → Documentation/devicetree/bindings/power/supply/charger-manager.txt

0
Documentation/devicetree/bindings/power/da9150-charger.txt → Documentation/devicetree/bindings/power/supply/da9150-charger.txt

0
Documentation/devicetree/bindings/power/da9150-fg.txt → Documentation/devicetree/bindings/power/supply/da9150-fg.txt

0
Documentation/devicetree/bindings/power_supply/gpio-charger.txt → Documentation/devicetree/bindings/power/supply/gpio-charger.txt

0
Documentation/devicetree/bindings/power/isp1704.txt → Documentation/devicetree/bindings/power/supply/isp1704.txt

0
Documentation/devicetree/bindings/power_supply/lp8727_charger.txt → Documentation/devicetree/bindings/power/supply/lp8727_charger.txt

0
Documentation/devicetree/bindings/power/ltc2941.txt → Documentation/devicetree/bindings/power/supply/ltc2941.txt

0
Documentation/devicetree/bindings/power_supply/max17042_battery.txt → Documentation/devicetree/bindings/power/supply/max17042_battery.txt

0
Documentation/devicetree/bindings/power_supply/max8925_batter.txt → Documentation/devicetree/bindings/power/supply/max8925_batter.txt

0
Documentation/devicetree/bindings/power_supply/olpc_battery.txt → Documentation/devicetree/bindings/power/supply/olpc_battery.txt

0
Documentation/devicetree/bindings/power_supply/power_supply.txt → Documentation/devicetree/bindings/power/supply/power_supply.txt

0
Documentation/devicetree/bindings/power/qcom,coincell-charger.txt → Documentation/devicetree/bindings/power/supply/qcom,coincell-charger.txt

0
Documentation/devicetree/bindings/power_supply/qcom_smbb.txt → Documentation/devicetree/bindings/power/supply/qcom_smbb.txt

0
Documentation/devicetree/bindings/power/rt9455_charger.txt → Documentation/devicetree/bindings/power/supply/rt9455_charger.txt

0
Documentation/devicetree/bindings/power/rx51-battery.txt → Documentation/devicetree/bindings/power/supply/rx51-battery.txt

0
Documentation/devicetree/bindings/power_supply/sbs_sbs-battery.txt → Documentation/devicetree/bindings/power/supply/sbs_sbs-battery.txt

0
Documentation/devicetree/bindings/power_supply/ti,bq24735.txt → Documentation/devicetree/bindings/power/supply/ti,bq24735.txt

0
Documentation/devicetree/bindings/power_supply/tps65090.txt → Documentation/devicetree/bindings/power/supply/tps65090.txt

0
Documentation/devicetree/bindings/power_supply/tps65217_charger.txt → Documentation/devicetree/bindings/power/supply/tps65217_charger.txt

0
Documentation/devicetree/bindings/power/twl-charger.txt → Documentation/devicetree/bindings/power/supply/twl-charger.txt

4
Documentation/driver-model/devres.txt

@ -346,6 +346,10 @@ PINCTRL
devm_pinctrl_register()
devm_pinctrl_unregister()
POWER
devm_reboot_mode_register()
devm_reboot_mode_unregister()
PWM
devm_pwm_get()
devm_pwm_put()

4
Documentation/power/power_supply_class.txt

@ -39,8 +39,8 @@ kind of power supply, and can process/present them to a user in consistent
manner. Results for different power supplies and machines are also directly
comparable.
See drivers/power/ds2760_battery.c and drivers/power/pda_power.c for the
example how to declare and handle attributes.
See drivers/power/supply/ds2760_battery.c and drivers/power/supply/pda_power.c
for the example how to declare and handle attributes.
Units

46
MAINTAINERS

@ -3784,8 +3784,8 @@ F: drivers/leds/leds-da90??.c
F: drivers/mfd/da903x.c
F: drivers/mfd/da90??-*.c
F: drivers/mfd/da91??-*.c
F: drivers/power/da9052-battery.c
F: drivers/power/da91??-*.c
F: drivers/power/supply/da9052-battery.c
F: drivers/power/supply/da91??-*.c
F: drivers/regulator/da903x.c
F: drivers/regulator/da9???-regulator.[ch]
F: drivers/rtc/rtc-da90??.c
@ -7579,8 +7579,8 @@ M: Krzysztof Kozlowski <krzk@kernel.org>
M: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
L: linux-pm@vger.kernel.org
S: Supported
F: drivers/power/max14577_charger.c
F: drivers/power/max77693_charger.c
F: drivers/power/supply/max14577_charger.c
F: drivers/power/supply/max77693_charger.c
MAXIM MAX77802 MULTIFUNCTION PMIC DEVICE DRIVERS
M: Javier Martinez Canillas <javier@osg.samsung.com>
@ -8486,11 +8486,11 @@ R: Pali Rohár <pali.rohar@gmail.com>
F: include/linux/power/bq2415x_charger.h
F: include/linux/power/bq27xxx_battery.h
F: include/linux/power/isp1704_charger.h
F: drivers/power/bq2415x_charger.c
F: drivers/power/bq27xxx_battery.c
F: drivers/power/bq27xxx_battery_i2c.c
F: drivers/power/isp1704_charger.c
F: drivers/power/rx51_battery.c
F: drivers/power/supply/bq2415x_charger.c
F: drivers/power/supply/bq27xxx_battery.c
F: drivers/power/supply/bq27xxx_battery_i2c.c
F: drivers/power/supply/isp1704_charger.c
F: drivers/power/supply/rx51_battery.c
NTB DRIVER CORE
M: Jon Mason <jdmason@kudzu.us>
@ -9490,16 +9490,12 @@ F: drivers/powercap/
POWER SUPPLY CLASS/SUBSYSTEM and DRIVERS
M: Sebastian Reichel <sre@kernel.org>
M: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
M: David Woodhouse <dwmw2@infradead.org>
L: linux-pm@vger.kernel.org
T: git git://git.infradead.org/battery-2.6.git
T: git git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git
S: Maintained
F: Documentation/devicetree/bindings/power/
F: Documentation/devicetree/bindings/power_supply/
F: Documentation/devicetree/bindings/power/supply/
F: include/linux/power_supply.h
F: drivers/power/
X: drivers/power/avs/
F: drivers/power/supply/
POWER STATE COORDINATION INTERFACE (PSCI)
M: Mark Rutland <mark.rutland@arm.com>
@ -10514,8 +10510,8 @@ F: drivers/thunderbolt/
TI BQ27XXX POWER SUPPLY DRIVER
R: Andrew F. Davis <afd@ti.com>
F: include/linux/power/bq27xxx_battery.h
F: drivers/power/bq27xxx_battery.c
F: drivers/power/bq27xxx_battery_i2c.c
F: drivers/power/supply/bq27xxx_battery.c
F: drivers/power/supply/bq27xxx_battery_i2c.c
TIMEKEEPING, CLOCKSOURCE CORE, NTP, ALARMTIMER
M: John Stultz <john.stultz@linaro.org>
@ -11512,6 +11508,14 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git
S: Supported
F: drivers/mfd/syscon.c
SYSTEM RESET/SHUTDOWN DRIVERS
M: Sebastian Reichel <sre@kernel.org>
L: linux-pm@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply.git
S: Maintained
F: Documentation/devicetree/bindings/power/reset/
F: drivers/power/reset/
SYSV FILESYSTEM
M: Christoph Hellwig <hch@infradead.org>
S: Maintained
@ -11860,7 +11864,7 @@ F: include/linux/platform_data/lp855x.h
TI LP8727 CHARGER DRIVER
M: Milo Kim <milo.kim@ti.com>
S: Maintained
F: drivers/power/lp8727_charger.c
F: drivers/power/supply/lp8727_charger.c
F: include/linux/platform_data/lp8727.h
TI LP8788 MFD DRIVER
@ -11869,7 +11873,7 @@ S: Maintained
F: drivers/iio/adc/lp8788_adc.c
F: drivers/leds/leds-lp8788.c
F: drivers/mfd/lp8788*.c
F: drivers/power/lp8788-charger.c
F: drivers/power/supply/lp8788-charger.c
F: drivers/regulator/lp8788-*.c
F: include/linux/mfd/lp8788*.h
@ -12946,7 +12950,7 @@ F: drivers/input/touchscreen/wm97*.c
F: drivers/mfd/arizona*
F: drivers/mfd/wm*.c
F: drivers/mfd/cs47l24*
F: drivers/power/wm83*.c
F: drivers/power/supply/wm83*.c
F: drivers/rtc/rtc-wm83*.c
F: drivers/regulator/wm8*.c
F: drivers/video/backlight/wm83*_bl.c

518
drivers/power/Kconfig

@ -1,517 +1,3 @@
menuconfig POWER_SUPPLY
bool "Power supply class support"
help
Say Y here to enable power supply class support. This allows
power supply (batteries, AC, USB) monitoring by userspace
via sysfs and uevent (if available) and/or APM kernel interface
(if selected below).
if POWER_SUPPLY
config POWER_SUPPLY_DEBUG
bool "Power supply debug"
help
Say Y here to enable debugging messages for power supply class
and drivers.
config PDA_POWER
tristate "Generic PDA/phone power driver"
depends on !S390
help
Say Y here to enable generic power driver for PDAs and phones with
one or two external power supplies (AC/USB) connected to main and
backup batteries, and optional builtin charger.
config APM_POWER
tristate "APM emulation for class batteries"
depends on APM_EMULATION
help
Say Y here to enable support APM status emulation using
battery class devices.
config GENERIC_ADC_BATTERY
tristate "Generic battery support using IIO"
depends on IIO
help
Say Y here to enable support for the generic battery driver
which uses IIO framework to read adc.
config MAX8925_POWER
tristate "MAX8925 battery charger support"
depends on MFD_MAX8925
help
Say Y here to enable support for the battery charger in the Maxim
MAX8925 PMIC.
config WM831X_BACKUP
tristate "WM831X backup battery charger support"
depends on MFD_WM831X
help
Say Y here to enable support for the backup battery charger
in the Wolfson Microelectronics WM831x PMICs.
config WM831X_POWER
tristate "WM831X PMU support"
depends on MFD_WM831X
help
Say Y here to enable support for the power management unit
provided by Wolfson Microelectronics WM831x PMICs.
config WM8350_POWER
tristate "WM8350 PMU support"
depends on MFD_WM8350
help
Say Y here to enable support for the power management unit
provided by the Wolfson Microelectronics WM8350 PMIC.
config TEST_POWER
tristate "Test power driver"
help
This driver is used for testing. It's safe to say M here.
config BATTERY_88PM860X
tristate "Marvell 88PM860x battery driver"
depends on MFD_88PM860X
help
Say Y here to enable battery monitor for Marvell 88PM860x chip.
config BATTERY_ACT8945A
tristate "Active-semi ACT8945A charger driver"
depends on MFD_ACT8945A || COMPILE_TEST
help
Say Y here to enable support for power supply provided by
Active-semi ActivePath ACT8945A charger.
config BATTERY_DS2760
tristate "DS2760 battery driver (HP iPAQ & others)"
depends on W1 && W1_SLAVE_DS2760
help
Say Y here to enable support for batteries with ds2760 chip.
config BATTERY_DS2780
tristate "DS2780 battery driver"
depends on HAS_IOMEM
select W1
select W1_SLAVE_DS2780
help
Say Y here to enable support for batteries with ds2780 chip.
config BATTERY_DS2781
tristate "DS2781 battery driver"
depends on HAS_IOMEM
select W1
select W1_SLAVE_DS2781
help
If you enable this you will have the DS2781 battery driver support.
The battery monitor chip is used in many batteries/devices
as the one who is responsible for charging/discharging/monitoring
Li+ batteries.
If you are unsure, say N.
config BATTERY_DS2782
tristate "DS2782/DS2786 standalone gas-gauge"
depends on I2C
help
Say Y here to enable support for the DS2782/DS2786 standalone battery
gas-gauge.
config BATTERY_PMU
tristate "Apple PMU battery"
depends on PPC32 && ADB_PMU
help
Say Y here to expose battery information on Apple machines
through the generic battery class.
config BATTERY_OLPC
tristate "One Laptop Per Child battery"
depends on X86_32 && OLPC
help
Say Y to enable support for the battery on the OLPC laptop.
config BATTERY_TOSA
tristate "Sharp SL-6000 (tosa) battery"
depends on MACH_TOSA && MFD_TC6393XB && TOUCHSCREEN_WM97XX
help
Say Y to enable support for the battery on the Sharp Zaurus
SL-6000 (tosa) models.
config BATTERY_COLLIE
tristate "Sharp SL-5500 (collie) battery"
depends on SA1100_COLLIE && MCP_UCB1200
help
Say Y to enable support for the battery on the Sharp Zaurus
SL-5500 (collie) models.
config BATTERY_IPAQ_MICRO
tristate "iPAQ Atmel Micro ASIC battery driver"
depends on MFD_IPAQ_MICRO
help
Choose this option if you want to monitor battery status on
Compaq/HP iPAQ h3100 and h3600.
config BATTERY_WM97XX
bool "WM97xx generic battery driver"
depends on TOUCHSCREEN_WM97XX=y
help
Say Y to enable support for battery measured by WM97xx aux port.
config BATTERY_SBS
tristate "SBS Compliant gas gauge"
depends on I2C
help
Say Y to include support for SBS battery driver for SBS-compliant
gas gauges.
config BATTERY_BQ27XXX
tristate "BQ27xxx battery driver"
help
Say Y here to enable support for batteries with BQ27xxx chips.
config BATTERY_BQ27XXX_I2C
tristate "BQ27xxx I2C support"
depends on BATTERY_BQ27XXX
depends on I2C
default y
help
Say Y here to enable support for batteries with BQ27xxx chips
connected over an I2C bus.
config BATTERY_DA9030
tristate "DA9030 battery driver"
depends on PMIC_DA903X
help
Say Y here to enable support for batteries charger integrated into
DA9030 PMIC.
config BATTERY_DA9052
tristate "Dialog DA9052 Battery"
depends on PMIC_DA9052
help
Say Y here to enable support for batteries charger integrated into
DA9052 PMIC.
config CHARGER_DA9150
tristate "Dialog Semiconductor DA9150 Charger support"
depends on MFD_DA9150
depends on DA9150_GPADC
depends on IIO
help
Say Y here to enable support for charger unit of the DA9150
Integrated Charger & Fuel-Gauge IC.
This driver can also be built as a module. If so, the module will be
called da9150-charger.
config BATTERY_DA9150
tristate "Dialog Semiconductor DA9150 Fuel Gauge support"
depends on MFD_DA9150
help
Say Y here to enable support for the Fuel-Gauge unit of the DA9150
Integrated Charger & Fuel-Gauge IC
This driver can also be built as a module. If so, the module will be
called da9150-fg.
config AXP288_CHARGER
tristate "X-Powers AXP288 Charger"
depends on MFD_AXP20X && EXTCON_AXP288
help
Say yes here to have support X-Power AXP288 power management IC (PMIC)
integrated charger.
config AXP288_FUEL_GAUGE
tristate "X-Powers AXP288 Fuel Gauge"
depends on MFD_AXP20X && IIO
help
Say yes here to have support for X-Power power management IC (PMIC)
Fuel Gauge. The device provides battery statistics and status
monitoring as well as alerts for battery over/under voltage and
over/under temperature.
config BATTERY_MAX17040
tristate "Maxim MAX17040 Fuel Gauge"
depends on I2C
help
MAX17040 is fuel-gauge systems for lithium-ion (Li+) batteries
in handheld and portable equipment. The MAX17040 is configured
to operate with a single lithium cell
config BATTERY_MAX17042
tristate "Maxim MAX17042/17047/17050/8997/8966 Fuel Gauge"
depends on I2C
select REGMAP_I2C
help
MAX17042 is fuel-gauge systems for lithium-ion (Li+) batteries
in handheld and portable equipment. The MAX17042 is configured
to operate with a single lithium cell. MAX8997 and MAX8966 are
multi-function devices that include fuel gauages that are compatible
with MAX17042. This driver also supports max17047/50 chips which are
improved version of max17042.
config BATTERY_Z2
tristate "Z2 battery driver"
depends on I2C && MACH_ZIPIT2
help
Say Y to include support for the battery on the Zipit Z2.
config BATTERY_S3C_ADC
tristate "Battery driver for Samsung ADC based monitoring"
depends on S3C_ADC
help
Say Y here to enable support for iPAQ h1930/h1940/rx1950 battery
config BATTERY_TWL4030_MADC
tristate "TWL4030 MADC battery driver"
depends on TWL4030_MADC
help
Say Y here to enable this dumb driver for batteries managed
through the TWL4030 MADC.
config CHARGER_88PM860X
tristate "Marvell 88PM860x Charger driver"
depends on MFD_88PM860X && BATTERY_88PM860X
help
Say Y here to enable charger for Marvell 88PM860x chip.
config CHARGER_PCF50633
tristate "NXP PCF50633 MBC"
depends on MFD_PCF50633
help
Say Y to include support for NXP PCF50633 Main Battery Charger.
config BATTERY_JZ4740
tristate "Ingenic JZ4740 battery"
depends on MACH_JZ4740
depends on MFD_JZ4740_ADC
help
Say Y to enable support for the battery on Ingenic JZ4740 based
boards.
This driver can be build as a module. If so, the module will be
called jz4740-battery.
config BATTERY_INTEL_MID
tristate "Battery driver for Intel MID platforms"
depends on INTEL_SCU_IPC && SPI
help
Say Y here to enable the battery driver on Intel MID
platforms.
config BATTERY_RX51
tristate "Nokia RX-51 (N900) battery driver"
depends on TWL4030_MADC
help
Say Y here to enable support for battery information on Nokia
RX-51, also known as N900 tablet.
config CHARGER_ISP1704
tristate "ISP1704 USB Charger Detection"
depends on USB_PHY
depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y'
help
Say Y to enable support for USB Charger Detection with
ISP1707/ISP1704 USB transceivers.
config CHARGER_MAX8903
tristate "MAX8903 Battery DC-DC Charger for USB and Adapter Power"
help
Say Y to enable support for the MAX8903 DC-DC charger and sysfs.
The driver supports controlling charger-enable and current-limit
pins based on the status of charger connections with interrupt
handlers.
config CHARGER_TWL4030
tristate "OMAP TWL4030 BCI charger driver"
depends on IIO && TWL4030_CORE
help
Say Y here to enable support for TWL4030 Battery Charge Interface.
config CHARGER_LP8727
tristate "TI/National Semiconductor LP8727 charger driver"
depends on I2C
help
Say Y here to enable support for LP8727 Charger Driver.
config CHARGER_LP8788
tristate "TI LP8788 charger driver"
depends on MFD_LP8788
depends on LP8788_ADC
depends on IIO
help
Say Y to enable support for the LP8788 linear charger.
config CHARGER_GPIO
tristate "GPIO charger"
depends on GPIOLIB || COMPILE_TEST
help
Say Y to include support for chargers which report their online status
through a GPIO pin.
This driver can be build as a module. If so, the module will be
called gpio-charger.
config CHARGER_MANAGER
bool "Battery charger manager for multiple chargers"
depends on REGULATOR
select EXTCON
help
Say Y to enable charger-manager support, which allows multiple
chargers attached to a battery and multiple batteries attached to a
system. The charger-manager also can monitor charging status in
runtime and in suspend-to-RAM by waking up the system periodically
with help of suspend_again support.
config CHARGER_MAX14577
tristate "Maxim MAX14577/77836 battery charger driver"
depends on MFD_MAX14577
help
Say Y to enable support for the battery charger control sysfs and
platform data of MAX14577/77836 MUICs.
config CHARGER_MAX77693
tristate "Maxim MAX77693 battery charger driver"
depends on MFD_MAX77693
help
Say Y to enable support for the Maxim MAX77693 battery charger.
config CHARGER_MAX8997
tristate "Maxim MAX8997/MAX8966 PMIC battery charger driver"
depends on MFD_MAX8997 && REGULATOR_MAX8997
help
Say Y to enable support for the battery charger control sysfs and
platform data of MAX8997/LP3974 PMICs.
config CHARGER_MAX8998
tristate "Maxim MAX8998/LP3974 PMIC battery charger driver"
depends on MFD_MAX8998 && REGULATOR_MAX8998
help
Say Y to enable support for the battery charger control sysfs and
platform data of MAX8998/LP3974 PMICs.
config CHARGER_QCOM_SMBB
tristate "Qualcomm Switch-Mode Battery Charger and Boost"
depends on MFD_SPMI_PMIC || COMPILE_TEST
depends on OF
depends on EXTCON
help
Say Y to include support for the Switch-Mode Battery Charger and
Boost (SMBB) hardware found in Qualcomm PM8941 PMICs. The charger
is an integrated, single-cell lithium-ion battery charger. DT
configuration is required for loading, see the devicetree
documentation for more detail. The base name for this driver is
'pm8941_charger'.
config CHARGER_BQ2415X
tristate "TI BQ2415x battery charger driver"
depends on I2C
help
Say Y to enable support for the TI BQ2415x battery charger
PMICs.
You'll need this driver to charge batteries on e.g. Nokia
RX-51/N900.
config CHARGER_BQ24190
tristate "TI BQ24190 battery charger driver"
depends on I2C
depends on GPIOLIB || COMPILE_TEST
help
Say Y to enable support for the TI BQ24190 battery charger.
config CHARGER_BQ24257
tristate "TI BQ24250/24251/24257 battery charger driver"
depends on I2C
depends on GPIOLIB || COMPILE_TEST
depends on REGMAP_I2C
help
Say Y to enable support for the TI BQ24250, BQ24251, and BQ24257 battery
chargers.
config CHARGER_BQ24735
tristate "TI BQ24735 battery charger support"
depends on I2C
depends on GPIOLIB || COMPILE_TEST
help
Say Y to enable support for the TI BQ24735 battery charger.
config CHARGER_BQ25890
tristate "TI BQ25890 battery charger driver"
depends on I2C
depends on GPIOLIB || COMPILE_TEST
select REGMAP_I2C
help
Say Y to enable support for the TI BQ25890 battery charger.
config CHARGER_SMB347
tristate "Summit Microelectronics SMB347 Battery Charger"
depends on I2C
select REGMAP_I2C
help
Say Y to include support for Summit Microelectronics SMB347
Battery Charger.
config CHARGER_TPS65090
tristate "TPS65090 battery charger driver"
depends on MFD_TPS65090
help
Say Y here to enable support for battery charging with TPS65090
PMIC chips.
config CHARGER_TPS65217
tristate "TPS65217 battery charger driver"
depends on MFD_TPS65217
help
Say Y here to enable support for battery charging with TPS65217
PMIC chips.
config BATTERY_GAUGE_LTC2941
tristate "LTC2941/LTC2943 Battery Gauge Driver"
depends on I2C
help
Say Y here to include support for LTC2941 and LTC2943 Battery
Gauge IC. The driver reports the charge count continuously, and
measures the voltage and temperature every 10 seconds.
config AB8500_BM
bool "AB8500 Battery Management Driver"
depends on AB8500_CORE && AB8500_GPADC
help
Say Y to include support for AB8500 battery management.
config BATTERY_GOLDFISH
tristate "Goldfish battery driver"
depends on GOLDFISH || COMPILE_TEST
depends on HAS_IOMEM
help
Say Y to enable support for the battery and AC power in the
Goldfish emulator.
config BATTERY_RT5033
tristate "RT5033 fuel gauge support"
depends on MFD_RT5033
help
This adds support for battery fuel gauge in Richtek RT5033 PMIC.
The fuelgauge calculates and determines the battery state of charge
according to battery open circuit voltage.
config CHARGER_RT9455
tristate "Richtek RT9455 battery charger driver"
depends on I2C
depends on GPIOLIB || COMPILE_TEST
select REGMAP_I2C
help
Say Y to enable support for Richtek RT9455 battery charger.
config AXP20X_POWER
tristate "AXP20x power supply driver"
depends on MFD_AXP20X
help
This driver provides support for the power supply features of
AXP20x PMIC.
endif # POWER_SUPPLY
source "drivers/power/reset/Kconfig"
source "drivers/power/avs/Kconfig"
source "drivers/power/reset/Kconfig"
source "drivers/power/supply/Kconfig"

75
drivers/power/Makefile

@ -1,76 +1,3 @@
subdir-ccflags-$(CONFIG_POWER_SUPPLY_DEBUG) := -DDEBUG
power_supply-y := power_supply_core.o
power_supply-$(CONFIG_SYSFS) += power_supply_sysfs.o
power_supply-$(CONFIG_LEDS_TRIGGERS) += power_supply_leds.o
obj-$(CONFIG_POWER_SUPPLY) += power_supply.o
obj-$(CONFIG_GENERIC_ADC_BATTERY) += generic-adc-battery.o
obj-$(CONFIG_PDA_POWER) += pda_power.o
obj-$(CONFIG_APM_POWER) += apm_power.o
obj-$(CONFIG_AXP20X_POWER) += axp20x_usb_power.o
obj-$(CONFIG_MAX8925_POWER) += max8925_power.o
obj-$(CONFIG_WM831X_BACKUP) += wm831x_backup.o
obj-$(CONFIG_WM831X_POWER) += wm831x_power.o
obj-$(CONFIG_WM8350_POWER) += wm8350_power.o
obj-$(CONFIG_TEST_POWER) += test_power.o
obj-$(CONFIG_BATTERY_88PM860X) += 88pm860x_battery.o
obj-$(CONFIG_BATTERY_ACT8945A) += act8945a_charger.o
obj-$(CONFIG_BATTERY_DS2760) += ds2760_battery.o
obj-$(CONFIG_BATTERY_DS2780) += ds2780_battery.o
obj-$(CONFIG_BATTERY_DS2781) += ds2781_battery.o
obj-$(CONFIG_BATTERY_DS2782) += ds2782_battery.o
obj-$(CONFIG_BATTERY_GAUGE_LTC2941) += ltc2941-battery-gauge.o
obj-$(CONFIG_BATTERY_GOLDFISH) += goldfish_battery.o
obj-$(CONFIG_BATTERY_PMU) += pmu_battery.o
obj-$(CONFIG_BATTERY_OLPC) += olpc_battery.o
obj-$(CONFIG_BATTERY_TOSA) += tosa_battery.o
obj-$(CONFIG_BATTERY_COLLIE) += collie_battery.o
obj-$(CONFIG_BATTERY_IPAQ_MICRO) += ipaq_micro_battery.o
obj-$(CONFIG_BATTERY_WM97XX) += wm97xx_battery.o
obj-$(CONFIG_BATTERY_SBS) += sbs-battery.o
obj-$(CONFIG_BATTERY_BQ27XXX) += bq27xxx_battery.o
obj-$(CONFIG_BATTERY_BQ27XXX_I2C) += bq27xxx_battery_i2c.o
obj-$(CONFIG_BATTERY_DA9030) += da9030_battery.o
obj-$(CONFIG_BATTERY_DA9052) += da9052-battery.o
obj-$(CONFIG_CHARGER_DA9150) += da9150-charger.o
obj-$(CONFIG_BATTERY_DA9150) += da9150-fg.o
obj-$(CONFIG_BATTERY_MAX17040) += max17040_battery.o
obj-$(CONFIG_BATTERY_MAX17042) += max17042_battery.o
obj-$(CONFIG_BATTERY_Z2) += z2_battery.o
obj-$(CONFIG_BATTERY_RT5033) += rt5033_battery.o
obj-$(CONFIG_CHARGER_RT9455) += rt9455_charger.o
obj-$(CONFIG_BATTERY_S3C_ADC) += s3c_adc_battery.o
obj-$(CONFIG_BATTERY_TWL4030_MADC) += twl4030_madc_battery.o
obj-$(CONFIG_CHARGER_88PM860X) += 88pm860x_charger.o
obj-$(CONFIG_CHARGER_PCF50633) += pcf50633-charger.o
obj-$(CONFIG_BATTERY_JZ4740) += jz4740-battery.o
obj-$(CONFIG_BATTERY_INTEL_MID) += intel_mid_battery.o
obj-$(CONFIG_BATTERY_RX51) += rx51_battery.o
obj-$(CONFIG_AB8500_BM) += ab8500_bmdata.o ab8500_charger.o ab8500_fg.o ab8500_btemp.o abx500_chargalg.o pm2301_charger.o
obj-$(CONFIG_CHARGER_ISP1704) += isp1704_charger.o
obj-$(CONFIG_CHARGER_MAX8903) += max8903_charger.o
obj-$(CONFIG_CHARGER_TWL4030) += twl4030_charger.o
obj-$(CONFIG_CHARGER_LP8727) += lp8727_charger.o
obj-$(CONFIG_CHARGER_LP8788) += lp8788-charger.o
obj-$(CONFIG_CHARGER_GPIO) += gpio-charger.o
obj-$(CONFIG_CHARGER_MANAGER) += charger-manager.o
obj-$(CONFIG_CHARGER_MAX14577) += max14577_charger.o
obj-$(CONFIG_CHARGER_MAX77693) += max77693_charger.o
obj-$(CONFIG_CHARGER_MAX8997) += max8997_charger.o
obj-$(CONFIG_CHARGER_MAX8998) += max8998_charger.o
obj-$(CONFIG_CHARGER_QCOM_SMBB) += qcom_smbb.o
obj-$(CONFIG_CHARGER_BQ2415X) += bq2415x_charger.o
obj-$(CONFIG_CHARGER_BQ24190) += bq24190_charger.o
obj-$(CONFIG_CHARGER_BQ24257) += bq24257_charger.o
obj-$(CONFIG_CHARGER_BQ24735) += bq24735-charger.o
obj-$(CONFIG_CHARGER_BQ25890) += bq25890_charger.o
obj-$(CONFIG_POWER_AVS) += avs/
obj-$(CONFIG_CHARGER_SMB347) += smb347-charger.o
obj-$(CONFIG_CHARGER_TPS65090) += tps65090-charger.o
obj-$(CONFIG_CHARGER_TPS65217) += tps65217_charger.o
obj-$(CONFIG_POWER_RESET) += reset/
obj-$(CONFIG_AXP288_FUEL_GAUGE) += axp288_fuel_gauge.o
obj-$(CONFIG_AXP288_CHARGER) += axp288_charger.o
obj-$(CONFIG_POWER_SUPPLY) += supply/

359
drivers/power/act8945a_charger.c

@ -1,359 +0,0 @@
/*
* Power supply driver for the Active-semi ACT8945A PMIC
*
* Copyright (C) 2015 Atmel Corporation
*
* Author: Wenyou Yang <wenyou.yang@atmel.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
*/
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_gpio.h>
#include <linux/platform_device.h>
#include <linux/power_supply.h>
#include <linux/regmap.h>
static const char *act8945a_charger_model = "ACT8945A";
static const char *act8945a_charger_manufacturer = "Active-semi";
/**
* ACT8945A Charger Register Map
*/
/* 0x70: Reserved */
#define ACT8945A_APCH_CFG 0x71
#define ACT8945A_APCH_STATUS 0x78
#define ACT8945A_APCH_CTRL 0x79
#define ACT8945A_APCH_STATE 0x7A
/* ACT8945A_APCH_CFG */
#define APCH_CFG_OVPSET (0x3 << 0)
#define APCH_CFG_OVPSET_6V6 (0x0 << 0)
#define APCH_CFG_OVPSET_7V (0x1 << 0)
#define APCH_CFG_OVPSET_7V5 (0x2 << 0)
#define APCH_CFG_OVPSET_8V (0x3 << 0)
#define APCH_CFG_PRETIMO (0x3 << 2)
#define APCH_CFG_PRETIMO_40_MIN (0x0 << 2)
#define APCH_CFG_PRETIMO_60_MIN (0x1 << 2)
#define APCH_CFG_PRETIMO_80_MIN (0x2 << 2)
#define APCH_CFG_PRETIMO_DISABLED (0x3 << 2)
#define APCH_CFG_TOTTIMO (0x3 << 4)
#define APCH_CFG_TOTTIMO_3_HOUR (0x0 << 4)
#define APCH_CFG_TOTTIMO_4_HOUR (0x1 << 4)
#define APCH_CFG_TOTTIMO_5_HOUR (0x2 << 4)
#define APCH_CFG_TOTTIMO_DISABLED (0x3 << 4)
#define APCH_CFG_SUSCHG (0x1 << 7)
#define APCH_STATUS_CHGDAT BIT(0)
#define APCH_STATUS_INDAT BIT(1)
#define APCH_STATUS_TEMPDAT BIT(2)
#define APCH_STATUS_TIMRDAT BIT(3)
#define APCH_STATUS_CHGSTAT BIT(4)
#define APCH_STATUS_INSTAT BIT(5)
#define APCH_STATUS_TEMPSTAT BIT(6)
#define APCH_STATUS_TIMRSTAT BIT(7)
#define APCH_CTRL_CHGEOCOUT BIT(0)
#define APCH_CTRL_INDIS BIT(1)
#define APCH_CTRL_TEMPOUT BIT(2)
#define APCH_CTRL_TIMRPRE BIT(3)
#define APCH_CTRL_CHGEOCIN BIT(4)
#define APCH_CTRL_INCON BIT(5)
#define APCH_CTRL_TEMPIN BIT(6)
#define APCH_CTRL_TIMRTOT BIT(7)
#define APCH_STATE_ACINSTAT (0x1 << 1)
#define APCH_STATE_CSTATE (0x3 << 4)
#define APCH_STATE_CSTATE_SHIFT 4
#define APCH_STATE_CSTATE_DISABLED 0x00
#define APCH_STATE_CSTATE_EOC 0x01
#define APCH_STATE_CSTATE_FAST 0x02
#define APCH_STATE_CSTATE_PRE 0x03
struct act8945a_charger {
struct regmap *regmap;
bool battery_temperature;
};
static int act8945a_get_charger_state(struct regmap *regmap, int *val)
{
int ret;
unsigned int status, state;
ret = regmap_read(regmap, ACT8945A_APCH_STATUS, &status);
if (ret < 0)
return ret;
ret = regmap_read(regmap, ACT8945A_APCH_STATE, &state);
if (ret < 0)
return ret;
state &= APCH_STATE_CSTATE;
state >>= APCH_STATE_CSTATE_SHIFT;
if (state == APCH_STATE_CSTATE_EOC) {
if (status & APCH_STATUS_CHGDAT)
*val = POWER_SUPPLY_STATUS_FULL;
else
*val = POWER_SUPPLY_STATUS_NOT_CHARGING;
} else if ((state == APCH_STATE_CSTATE_FAST) ||
(state == APCH_STATE_CSTATE_PRE)) {
*val = POWER_SUPPLY_STATUS_CHARGING;
} else {
*val = POWER_SUPPLY_STATUS_NOT_CHARGING;
}
return 0;
}
static int act8945a_get_charge_type(struct regmap *regmap, int *val)
{
int ret;
unsigned int state;
ret = regmap_read(regmap, ACT8945A_APCH_STATE, &state);
if (ret < 0)
return ret;
state &= APCH_STATE_CSTATE;
state >>= APCH_STATE_CSTATE_SHIFT;
switch (state) {
case APCH_STATE_CSTATE_PRE:
*val = POWER_SUPPLY_CHARGE_TYPE_TRICKLE;
break;
case APCH_STATE_CSTATE_FAST:
*val = POWER_SUPPLY_CHARGE_TYPE_FAST;
break;
case APCH_STATE_CSTATE_EOC:
case APCH_STATE_CSTATE_DISABLED:
default:
*val = POWER_SUPPLY_CHARGE_TYPE_NONE;
}
return 0;
}
static int act8945a_get_battery_health(struct act8945a_charger *charger,
struct regmap *regmap, int *val)
{
int ret;
unsigned int status;
ret = regmap_read(regmap, ACT8945A_APCH_STATUS, &status);
if (ret < 0)
return ret;
if (charger->battery_temperature && !(status & APCH_STATUS_TEMPDAT))
*val = POWER_SUPPLY_HEALTH_OVERHEAT;
else if (!(status & APCH_STATUS_INDAT))
*val = POWER_SUPPLY_HEALTH_OVERVOLTAGE;
else if (status & APCH_STATUS_TIMRDAT)
*val = POWER_SUPPLY_HEALTH_SAFETY_TIMER_EXPIRE;
else
*val = POWER_SUPPLY_HEALTH_GOOD;
return 0;
}
static enum power_supply_property act8945a_charger_props[] = {
POWER_SUPPLY_PROP_STATUS,
POWER_SUPPLY_PROP_CHARGE_TYPE,
POWER_SUPPLY_PROP_TECHNOLOGY,
POWER_SUPPLY_PROP_HEALTH,
POWER_SUPPLY_PROP_MODEL_NAME,
POWER_SUPPLY_PROP_MANUFACTURER
};
static int act8945a_charger_get_property(struct power_supply *psy,
enum power_supply_property prop,
union power_supply_propval *val)
{
struct act8945a_charger *charger = power_supply_get_drvdata(psy);
struct regmap *regmap = charger->regmap;
int ret = 0;
switch (prop) {
case POWER_SUPPLY_PROP_STATUS:
ret = act8945a_get_charger_state(regmap, &val->intval);
break;
case POWER_SUPPLY_PROP_CHARGE_TYPE:
ret = act8945a_get_charge_type(regmap, &val->intval);
break;
case POWER_SUPPLY_PROP_TECHNOLOGY:
val->intval = POWER_SUPPLY_TECHNOLOGY_LION;
break;
case POWER_SUPPLY_PROP_HEALTH:
ret = act8945a_get_battery_health(charger,
regmap, &val->intval);
break;
case POWER_SUPPLY_PROP_MODEL_NAME:
val->strval = act8945a_charger_model;
break;
case POWER_SUPPLY_PROP_MANUFACTURER:
val->strval = act8945a_charger_manufacturer;
break;
default:
return -EINVAL;
}
return ret;
}
static const struct power_supply_desc act8945a_charger_desc = {
.name = "act8945a-charger",
.type = POWER_SUPPLY_TYPE_BATTERY,
.get_property = act8945a_charger_get_property,
.properties = act8945a_charger_props,
.num_properties = ARRAY_SIZE(act8945a_charger_props),
};
#define DEFAULT_TOTAL_TIME_OUT 3
#define DEFAULT_PRE_TIME_OUT 40
#define DEFAULT_INPUT_OVP_THRESHOLD 6600
static int act8945a_charger_config(struct device *dev,
struct act8945a_charger *charger)
{
struct device_node *np = dev->of_node;
enum of_gpio_flags flags;
struct regmap *regmap = charger->regmap;
u32 total_time_out;
u32 pre_time_out;
u32 input_voltage_threshold;
int chglev_pin;
unsigned int value = 0;
if (!np) {
dev_err(dev, "no charger of node\n");
return -EINVAL;
}
charger->battery_temperature = of_property_read_bool(np,
"active-semi,check-battery-temperature");
chglev_pin = of_get_named_gpio_flags(np,
"active-semi,chglev-gpios", 0, &flags);
if (gpio_is_valid(chglev_pin)) {
gpio_set_value(chglev_pin,
((flags == OF_GPIO_ACTIVE_LOW) ? 0 : 1));
}
if (of_property_read_u32(np,
"active-semi,input-voltage-threshold-microvolt",
&input_voltage_threshold))
input_voltage_threshold = DEFAULT_INPUT_OVP_THRESHOLD;
if (of_property_read_u32(np,
"active-semi,precondition-timeout",
&pre_time_out))
pre_time_out = DEFAULT_PRE_TIME_OUT;
if (of_property_read_u32(np, "active-semi,total-timeout",
&total_time_out))
total_time_out = DEFAULT_TOTAL_TIME_OUT;
switch (input_voltage_threshold) {
case 8000:
value |= APCH_CFG_OVPSET_8V;
break;
case 7500:
value |= APCH_CFG_OVPSET_7V5;
break;
case 7000:
value |= APCH_CFG_OVPSET_7V;
break;
case 6600:
default:
value |= APCH_CFG_OVPSET_6V6;
break;
}
switch (pre_time_out) {
case 60:
value |= APCH_CFG_PRETIMO_60_MIN;
break;
case 80:
value |= APCH_CFG_PRETIMO_80_MIN;
break;
case 0:
value |= APCH_CFG_PRETIMO_DISABLED;
break;
case 40:
default:
value |= APCH_CFG_PRETIMO_40_MIN;
break;
}
switch (total_time_out) {
case 4:
value |= APCH_CFG_TOTTIMO_4_HOUR;
break;
case 5:
value |= APCH_CFG_TOTTIMO_5_HOUR;
break;
case 0:
value |= APCH_CFG_TOTTIMO_DISABLED;
break;
case 3:
default:
value |= APCH_CFG_TOTTIMO_3_HOUR;
break;
}
return regmap_write(regmap, ACT8945A_APCH_CFG, value);
}
static int act8945a_charger_probe(struct platform_device *pdev)
{
struct act8945a_charger *charger;
struct power_supply *psy;
struct power_supply_config psy_cfg = {};
int ret;
charger = devm_kzalloc(&pdev->dev, sizeof(*charger), GFP_KERNEL);
if (!charger)
return -ENOMEM;
charger->regmap = dev_get_regmap(pdev->dev.parent, NULL);
if (!charger->regmap) {
dev_err(&pdev->dev, "Parent did not provide regmap\n");
return -EINVAL;
}
ret = act8945a_charger_config(pdev->dev.parent, charger);
if (ret)
return ret;
psy_cfg.of_node = pdev->dev.parent->of_node;
psy_cfg.drv_data = charger;
psy = devm_power_supply_register(&pdev->dev,
&act8945a_charger_desc,
&psy_cfg);
if (IS_ERR(psy)) {
dev_err(&pdev->dev, "failed to register power supply\n");
return PTR_ERR(psy);
}
return 0;
}
static struct platform_driver act8945a_charger_driver = {
.driver = {
.name = "act8945a-charger",
},
.probe = act8945a_charger_probe,
};
module_platform_driver(act8945a_charger_driver);
MODULE_DESCRIPTION("Active-semi ACT8945A ActivePath charger driver");
MODULE_AUTHOR("Wenyou Yang <wenyou.yang@atmel.com>");
MODULE_LICENSE("GPL");

2
drivers/power/reset/keystone-reset.c

@ -139,7 +139,7 @@ static int rsctrl_probe(struct platform_device *pdev)
}
if (val >= WDT_MUX_NUMBER) {
dev_err(dev, "ti,wdt-list property can contain"
dev_err(dev, "ti,wdt-list property can contain "
"only numbers < 4\n");
return -EINVAL;
}

59
drivers/power/reset/reboot-mode.c

@ -135,6 +135,65 @@ int reboot_mode_unregister(struct reboot_mode_driver *reboot)
}
EXPORT_SYMBOL_GPL(reboot_mode_unregister);
static void devm_reboot_mode_release(struct device *dev, void *res)
{
reboot_mode_unregister(*(struct reboot_mode_driver **)res);
}
/**
* devm_reboot_mode_register() - resource managed reboot_mode_register()
* @dev: device to associate this resource with
* @reboot: reboot mode driver
*
* Returns: 0 on success or a negative error code on failure.
*/
int devm_reboot_mode_register(struct device *dev,
struct reboot_mode_driver *reboot)
{
struct reboot_mode_driver **dr;
int rc;
dr = devres_alloc(devm_reboot_mode_release, sizeof(*dr), GFP_KERNEL);
if (!dr)
return -ENOMEM;
rc = reboot_mode_register(reboot);
if (rc) {
devres_free(dr);
return rc;
}
*dr = reboot;
devres_add(dev, dr);
return 0;
}
EXPORT_SYMBOL_GPL(devm_reboot_mode_register);
static int devm_reboot_mode_match(struct device *dev, void *res, void *data)
{
struct reboot_mode_driver **p = res;
if (WARN_ON(!p || !*p))
return 0;
return *p == data;
}
/**
* devm_reboot_mode_unregister() - resource managed reboot_mode_unregister()
* @dev: device to associate this resource with
* @reboot: reboot mode driver
*/
void devm_reboot_mode_unregister(struct device *dev,
struct reboot_mode_driver *reboot)
{
WARN_ON(devres_release(dev,
devm_reboot_mode_release,
devm_reboot_mode_match, reboot));
}
EXPORT_SYMBOL_GPL(devm_reboot_mode_unregister);
MODULE_AUTHOR("Andy Yan <andy.yan@rock-chips.com");
MODULE_DESCRIPTION("System reboot mode core library");
MODULE_LICENSE("GPL v2");

4
drivers/power/reset/reboot-mode.h

@ -10,5 +10,9 @@ struct reboot_mode_driver {
int reboot_mode_register(struct reboot_mode_driver *reboot);
int reboot_mode_unregister(struct reboot_mode_driver *reboot);
int devm_reboot_mode_register(struct device *dev,
struct reboot_mode_driver *reboot);
void devm_reboot_mode_unregister(struct device *dev,
struct reboot_mode_driver *reboot);
#endif

41
drivers/power/reset/st-poweroff.c

@ -28,28 +28,6 @@ struct reset_syscfg {
unsigned int mask_rst_msk;
};
/* STiH415 */
#define STIH415_SYSCFG_11 0x2c
#define STIH415_SYSCFG_15 0x3c
static struct reset_syscfg stih415_reset = {
.offset_rst = STIH415_SYSCFG_11,
.mask_rst = BIT(0),
.offset_rst_msk = STIH415_SYSCFG_15,
.mask_rst_msk = BIT(0)
};
/* STiH416 */
#define STIH416_SYSCFG_500 0x7d0
#define STIH416_SYSCFG_504 0x7e0
static struct reset_syscfg stih416_reset = {
.offset_rst = STIH416_SYSCFG_500,
.mask_rst = BIT(0),
.offset_rst_msk = STIH416_SYSCFG_504,
.mask_rst_msk = BIT(0)
};
/* STiH407 */
#define STIH407_SYSCFG_4000 0x0
#define STIH407_SYSCFG_4008 0x20
@ -61,16 +39,6 @@ static struct reset_syscfg stih407_reset = {
.mask_rst_msk = BIT(0)
};
/* STiD127 */
#define STID127_SYSCFG_700 0x0
#define STID127_SYSCFG_773 0x124
static struct reset_syscfg stid127_reset = {
.offset_rst = STID127_SYSCFG_773,
.mask_rst = BIT(0),
.offset_rst_msk = STID127_SYSCFG_700,
.mask_rst_msk = BIT(8)
};
static struct reset_syscfg *st_restart_syscfg;
@ -99,17 +67,8 @@ static struct notifier_block st_restart_nb = {
static const struct of_device_id st_reset_of_match[] = {
{
.compatible = "st,stih415-restart",
.data = (void *)&stih415_reset,
}, {
.compatible = "st,stih416-restart",
.data = (void *)&stih416_reset,
}, {
.compatible = "st,stih407-restart",
.data = (void *)&stih407_reset,
}, {
.compatible = "st,stid127-restart",
.data = (void *)&stid127_reset,
},
{}
};

12
drivers/power/reset/syscon-reboot-mode.c

@ -53,8 +53,6 @@ static int syscon_reboot_mode_probe(struct platform_device *pdev)
syscon_rbm->reboot.write = syscon_reboot_mode_write;
syscon_rbm->mask = 0xffffffff;
dev_set_drvdata(&pdev->dev, syscon_rbm);
syscon_rbm->map = syscon_node_to_regmap(pdev->dev.parent->of_node);
if (IS_ERR(syscon_rbm->map))
return PTR_ERR(syscon_rbm->map);
@ -65,20 +63,13 @@ static int syscon_reboot_mode_probe(struct platform_device *pdev)
of_property_read_u32(pdev->dev.of_node, "mask", &syscon_rbm->mask);
ret = reboot_mode_register(&syscon_rbm->reboot);
ret = devm_reboot_mode_register(&pdev->dev, &syscon_rbm->reboot);
if (ret)
dev_err(&pdev->dev, "can't register reboot mode\n");
return ret;
}
static int syscon_reboot_mode_remove(struct platform_device *pdev)
{
struct syscon_reboot_mode *syscon_rbm = dev_get_drvdata(&pdev->dev);
return reboot_mode_unregister(&syscon_rbm->reboot);
}
static const struct of_device_id syscon_reboot_mode_of_match[] = {
{ .compatible = "syscon-reboot-mode" },
{}
@ -86,7 +77,6 @@ static const struct of_device_id syscon_reboot_mode_of_match[] = {
static struct platform_driver syscon_reboot_mode_driver = {
.probe = syscon_reboot_mode_probe,
.remove = syscon_reboot_mode_remove,
.driver = {
.name = "syscon-reboot-mode",
.of_match_table = syscon_reboot_mode_of_match,

4
drivers/power/reset/xgene-reboot.c

@ -81,8 +81,10 @@ static int xgene_reboot_probe(struct platform_device *pdev)
ctx->restart_handler.notifier_call = xgene_restart_handler;
ctx->restart_handler.priority = 128;
err = register_restart_handler(&ctx->restart_handler);
if (err)
if (err) {
iounmap(ctx->csr);
dev_err(dev, "cannot register restart handler (err=%d)\n", err);
}
return err;
}

5
drivers/power/reset/zx-reboot.c

@ -58,9 +58,12 @@ static int zx_reboot_probe(struct platform_device *pdev)
}
err = register_restart_handler(&zx_restart_nb);
if (err)
if (err) {
iounmap(base);
iounmap(pcu_base);
dev_err(&pdev->dev, "Register restart handler failed(err=%d)\n",
err);
}
return err;
}

0
drivers/power/88pm860x_battery.c → drivers/power/supply/88pm860x_battery.c

0
drivers/power/88pm860x_charger.c → drivers/power/supply/88pm860x_charger.c

514
drivers/power/supply/Kconfig

@ -0,0 +1,514 @@
menuconfig POWER_SUPPLY
bool "Power supply class support"
help
Say Y here to enable power supply class support. This allows
power supply (batteries, AC, USB) monitoring by userspace
via sysfs and uevent (if available) and/or APM kernel interface
(if selected below).
if POWER_SUPPLY
config POWER_SUPPLY_DEBUG
bool "Power supply debug"
help
Say Y here to enable debugging messages for power supply class
and drivers.
config PDA_POWER
tristate "Generic PDA/phone power driver"
depends on !S390
help
Say Y here to enable generic power driver for PDAs and phones with
one or two external power supplies (AC/USB) connected to main and
backup batteries, and optional builtin charger.
config APM_POWER
tristate "APM emulation for class batteries"
depends on APM_EMULATION
help
Say Y here to enable support APM status emulation using
battery class devices.
config GENERIC_ADC_BATTERY
tristate "Generic battery support using IIO"
depends on IIO
help
Say Y here to enable support for the generic battery driver