Commit f0459fe1 authored by Maxime Ripard's avatar Maxime Ripard Committed by Sebastian Reichel

power: supply: Fix the simple battery property names

Commit c08b1f45 ("power: supply: core: Add power_supply_battery_info
and API") introduced code to parse the simple-battery node and express
battery charging constraints. However, it parsed that node using the
properties constant_charge_current_max_microamp and
constant_charge_voltage_max_microvolt, while the device tree binding for
the simple-battery node uses dashes to separate the words in those
properties (constant-charge-current-max-microamp and
constant-charge-voltage-max-microvolt).

Let's make the code match the binding.

Fixes: c08b1f45 ("power: supply: core: Add power_supply_battery_info and API")
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 75cf4f5a
......@@ -620,9 +620,9 @@ int power_supply_get_battery_info(struct power_supply *psy,
&info->precharge_current_ua);
of_property_read_u32(battery_np, "charge-term-current-microamp",
&info->charge_term_current_ua);
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);
of_property_read_u32(battery_np, "constant_charge_voltage_max_microvolt",
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);
......
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