Skip to content

Commit

Permalink
power: supply: axp288_charger: Fix initial constant_charge_current value
Browse files Browse the repository at this point in the history
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: eac53b3 ("power: supply: axp288_charger: Drop platform_data dependency")
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
  • Loading branch information
Hans de Goede authored and Sebastian Reichel committed Jul 6, 2018
1 parent ada1de8 commit f2a4259
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/power/supply/axp288_charger.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit f2a4259

Please sign in to comment.