From c08b1f45d7d193b3e6dcbbf30d403cb49b667b8c Mon Sep 17 00:00:00 2001 From: Liam Breck Date: Wed, 7 Jun 2017 11:37:51 -0700 Subject: 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 Signed-off-by: Liam Breck Signed-off-by: Sebastian Reichel --- Documentation/power/power_supply_class.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Documentation/power') 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? -- cgit v1.2.3