Commit 5a63b7ba authored by Matti Vaittinen's avatar Matti Vaittinen Committed by Sebastian Reichel

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: default avatarMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent e3420b49
...@@ -620,10 +620,18 @@ int power_supply_get_battery_info(struct power_supply *psy, ...@@ -620,10 +620,18 @@ int power_supply_get_battery_info(struct power_supply *psy,
&info->voltage_min_design_uv); &info->voltage_min_design_uv);
of_property_read_u32(battery_np, "voltage-max-design-microvolt", of_property_read_u32(battery_np, "voltage-max-design-microvolt",
&info->voltage_max_design_uv); &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", of_property_read_u32(battery_np, "precharge-current-microamp",
&info->precharge_current_ua); &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", of_property_read_u32(battery_np, "charge-term-current-microamp",
&info->charge_term_current_ua); &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", of_property_read_u32(battery_np, "constant-charge-current-max-microamp",
&info->constant_charge_current_max_ua); &info->constant_charge_current_max_ua);
of_property_read_u32(battery_np, "constant-charge-voltage-max-microvolt", of_property_read_u32(battery_np, "constant-charge-voltage-max-microvolt",
......
...@@ -346,8 +346,12 @@ struct power_supply_battery_info { ...@@ -346,8 +346,12 @@ struct power_supply_battery_info {
int charge_full_design_uah; /* microAmp-hours */ int charge_full_design_uah; /* microAmp-hours */
int voltage_min_design_uv; /* microVolts */ int voltage_min_design_uv; /* microVolts */
int voltage_max_design_uv; /* microVolts */ int voltage_max_design_uv; /* microVolts */
int tricklecharge_current_ua; /* microAmps */
int precharge_current_ua; /* microAmps */ int precharge_current_ua; /* microAmps */
int precharge_voltage_max_uv; /* microVolts */
int charge_term_current_ua; /* microAmps */ int charge_term_current_ua; /* microAmps */
int charge_restart_voltage_uv; /* microVolts */
int overvoltage_limit_uv; /* microVolts */
int constant_charge_current_max_ua; /* microAmps */ int constant_charge_current_max_ua; /* microAmps */
int constant_charge_voltage_max_uv; /* microVolts */ int constant_charge_voltage_max_uv; /* microVolts */
int factory_internal_resistance_uohm; /* microOhms */ int factory_internal_resistance_uohm; /* microOhms */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment