summaryrefslogtreecommitdiffstats
path: root/Documentation/power
diff options
context:
space:
mode:
authorLiam Breck <kernel@networkimprov.net>2017-06-07 11:37:51 -0700
committerSebastian Reichel <sebastian.reichel@collabora.co.uk>2017-06-08 16:29:28 +0200
commitc08b1f45d7d193b3e6dcbbf30d403cb49b667b8c (patch)
tree9f7389a87a3d8ff991f61d70d8224adee4f1e3f8 /Documentation/power
parent230670479a6c54dcae6387119bb7d4441d7870b2 (diff)
downloadblackbird-op-linux-c08b1f45d7d193b3e6dcbbf30d403cb49b667b8c.tar.gz
blackbird-op-linux-c08b1f45d7d193b3e6dcbbf30d403cb49b667b8c.zip
power: supply: core: Add power_supply_battery_info and API
power_supply_get_battery_info() reads battery data from devicetree. struct power_supply_battery_info provides battery data to drivers. Its fields correspond to elements in enum power_supply_property. Drivers may surface battery data in sysfs via corresponding POWER_SUPPLY_PROP_* fields. Signed-off-by: Matt Ranostay <matt@ranostay.consulting> Signed-off-by: Liam Breck <kernel@networkimprov.net> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Diffstat (limited to 'Documentation/power')
-rw-r--r--Documentation/power/power_supply_class.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/Documentation/power/power_supply_class.txt b/Documentation/power/power_supply_class.txt
index 0c72588bd967..01f007591070 100644
--- a/Documentation/power/power_supply_class.txt
+++ b/Documentation/power/power_supply_class.txt
@@ -174,6 +174,18 @@ issued by external power supply will notify supplicants via
external_power_changed callback.
+Devicetree battery characteristics
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Drivers should call power_supply_get_battery_info() to obtain battery
+characteristics from a devicetree battery node, defined in
+Documentation/devicetree/bindings/power/supply/battery.txt. This is
+implemented in drivers/power/supply/bq27xxx_battery.c.
+
+Properties in struct power_supply_battery_info and their counterparts in the
+battery node have names corresponding to elements in enum power_supply_property,
+for naming consistency between sysfs attributes and battery node properties.
+
+
QA
~~
Q: Where is POWER_SUPPLY_PROP_XYZ attribute?
OpenPOWER on IntegriCloud