Commit 6dcfa009 authored by Sebastian Krzyszkowiak's avatar Sebastian Krzyszkowiak Committed by Sebastian Reichel

power: supply: max17042_battery: Take r_sns value into account in charge_counter

The default r_sns value was hardcoded there, so let's change it to the
actually configured one.
Signed-off-by: default avatarSebastian Krzyszkowiak <sebastian.krzyszkowiak@puri.sm>
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.com>
parent 9e39ef14
...@@ -354,7 +354,8 @@ static int max17042_get_property(struct power_supply *psy, ...@@ -354,7 +354,8 @@ static int max17042_get_property(struct power_supply *psy,
if (ret < 0) if (ret < 0)
return ret; return ret;
val->intval = data * 1000 / 2; data64 = sign_extend64(data, 15) * 5000000ll;
val->intval = div_s64(data64, chip->pdata->r_sns);
break; break;
case POWER_SUPPLY_PROP_TEMP: case POWER_SUPPLY_PROP_TEMP:
ret = max17042_get_temperature(chip, &val->intval); ret = max17042_get_temperature(chip, &val->intval);
......
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