Commit f2a42595 authored by Hans de Goede's avatar Hans de Goede Committed by Sebastian Reichel

power: supply: axp288_charger: Fix initial constant_charge_current value

We should look at val which contains the value read from the register,
not ret which is always 0 on a successful read.
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
Fixes: eac53b36 ("power: supply: axp288_charger: Drop platform_data dependency")
Signed-off-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
parent ada1de89
......@@ -718,7 +718,7 @@ static int charger_init_hw_regs(struct axp288_chrg_info *info)
}
/* Determine charge current limit */
cc = (ret & CHRG_CCCV_CC_MASK) >> CHRG_CCCV_CC_BIT_POS;
cc = (val & CHRG_CCCV_CC_MASK) >> CHRG_CCCV_CC_BIT_POS;
cc = (cc * CHRG_CCCV_CC_LSB_RES) + CHRG_CCCV_CC_OFFSET;
info->cc = cc;
......
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