power: supply: axp288_charger: Fix initial constant_charge_current value
[ Upstream commit f2a42595f0865886a2d40524b0e9d15600848670 ] 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: Hans de Goede <hdegoede@redhat.com> Fixes: eac53b3664f59 ("power: supply: axp288_charger: Drop platform_data dependency") Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2efa4bd5aa
commit
914b4daa9b
@ -771,7 +771,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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user