diff options
author | Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com> | 2020-05-08 18:47:20 +0300 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2020-05-10 02:35:49 +0200 |
commit | 5a63b7ba50fd6b7a897bf9353dbf31d579cfe116 (patch) | |
tree | 31bd0f26002b6cd328f4074937572f1fed2b577d /drivers/power/supply | |
parent | e3420b49949c79d6182dd8128fa7a3958da01b07 (diff) |
power: supply: add battery parameters
Add parsing of new device-tree battery bindings.
- trickle-charge-current-microamp
- precharge-upper-limit-microvolt
- re-charge-voltage-microvolt
- over-voltage-threshold-microvolt
Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'drivers/power/supply')
-rw-r--r-- | drivers/power/supply/power_supply_core.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/power/supply/power_supply_core.c b/drivers/power/supply/power_supply_core.c index 1a9a9fae73d3..02b37fe6061c 100644 --- a/drivers/power/supply/power_supply_core.c +++ b/drivers/power/supply/power_supply_core.c @@ -620,10 +620,18 @@ int power_supply_get_battery_info(struct power_supply *psy, &info->voltage_min_design_uv); of_property_read_u32(battery_np, "voltage-max-design-microvolt", &info->voltage_max_design_uv); + of_property_read_u32(battery_np, "trickle-charge-current-microamp", + &info->tricklecharge_current_ua); of_property_read_u32(battery_np, "precharge-current-microamp", &info->precharge_current_ua); + of_property_read_u32(battery_np, "precharge-upper-limit-microvolt", + &info->precharge_voltage_max_uv); of_property_read_u32(battery_np, "charge-term-current-microamp", &info->charge_term_current_ua); + of_property_read_u32(battery_np, "re-charge-voltage-microvolt", + &info->charge_restart_voltage_uv); + of_property_read_u32(battery_np, "over-voltage-threshold-microvolt", + &info->overvoltage_limit_uv); of_property_read_u32(battery_np, "constant-charge-current-max-microamp", &info->constant_charge_current_max_ua); of_property_read_u32(battery_np, "constant-charge-voltage-max-microvolt", |