summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSebastian Reichel <sre@kernel.org>2023-03-18 01:56:55 +0300
committerSebastian Reichel <sre@kernel.org>2023-03-29 23:38:56 +0300
commit27a2195efa8d26447c40dd4a6299ea0247786d75 (patch)
treeac9c6b1f32f49d94216230b6477c2fb1c5e22e15 /include
parent25b800631773163a0bbf8b761d7ea4f921f3cfba (diff)
downloadlinux-27a2195efa8d26447c40dd4a6299ea0247786d75.tar.xz
power: supply: core: auto-exposure of simple-battery data
Automatically expose data from the simple-battery firmware node for all battery drivers. Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Matti Vaittinen <mazziesaccount@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/power_supply.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index aa2c4a7c4826..a427f13c757f 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -301,6 +301,7 @@ struct power_supply {
bool initialized;
bool removing;
atomic_t use_cnt;
+ struct power_supply_battery_info *battery_info;
#ifdef CONFIG_THERMAL
struct thermal_zone_device *tzd;
struct thermal_cooling_device *tcd;
@@ -791,10 +792,17 @@ devm_power_supply_get_by_phandle(struct device *dev, const char *property)
{ return NULL; }
#endif /* CONFIG_OF */
+extern const enum power_supply_property power_supply_battery_info_properties[];
+extern const size_t power_supply_battery_info_properties_size;
extern int power_supply_get_battery_info(struct power_supply *psy,
struct power_supply_battery_info **info_out);
extern void power_supply_put_battery_info(struct power_supply *psy,
struct power_supply_battery_info *info);
+extern bool power_supply_battery_info_has_prop(struct power_supply_battery_info *info,
+ enum power_supply_property psp);
+extern int power_supply_battery_info_get_prop(struct power_supply_battery_info *info,
+ enum power_supply_property psp,
+ union power_supply_propval *val);
extern int power_supply_ocv2cap_simple(struct power_supply_battery_ocv_table *table,
int table_len, int ocv);
extern struct power_supply_battery_ocv_table *