diff options
author | Baolin Wang <baolin.wang@linaro.org> | 2018-11-05 15:39:07 +0800 |
---|---|---|
committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2018-11-09 22:55:46 +0100 |
commit | 86131d933f9a9502d877fb37b90a856e6a8a7ed8 (patch) | |
tree | 3c6fa7f3f8215189bad368e4e6c511ce4e8fb450 /drivers/power/supply/power_supply_core.c | |
parent | 56a6cd3196c6617697b46c3861dfd06579ef43d2 (diff) | |
download | linux-86131d933f9a9502d877fb37b90a856e6a8a7ed8.tar.gz linux-86131d933f9a9502d877fb37b90a856e6a8a7ed8.tar.bz2 linux-86131d933f9a9502d877fb37b90a856e6a8a7ed8.zip |
power: supply: core: Add one field to present the battery internal resistance
Add one field for 'struct power_supply_battery_info' to present the battery
factory internal resistance.
Signed-off-by: Baolin Wang <baolin.wang@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/supply/power_supply_core.c')
-rw-r--r-- | drivers/power/supply/power_supply_core.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index e85361878450..307e0995ca3c 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -579,6 +579,7 @@ int power_supply_get_battery_info(struct power_supply *psy, info->charge_term_current_ua = -EINVAL; info->constant_charge_current_max_ua = -EINVAL; info->constant_charge_voltage_max_uv = -EINVAL; + info->factory_internal_resistance_uohm = -EINVAL; if (!psy->of_node) { dev_warn(&psy->dev, "%s currently only supports devicetree\n", @@ -616,6 +617,8 @@ int power_supply_get_battery_info(struct power_supply *psy, &info->constant_charge_current_max_ua); of_property_read_u32(battery_np, "constant_charge_voltage_max_microvolt", &info->constant_charge_voltage_max_uv); + of_property_read_u32(battery_np, "factory-internal-resistance-micro-ohms", + &info->factory_internal_resistance_uohm); return 0; } |