power: max77660-charger-extcon: Program charging current correctly
Darbha Sriharsha [Fri, 14 Jun 2013 06:59:22 +0000 (11:59 +0530)]
Program the charging current value obtained from the regulator
into the charger registers instead of programming a hard-coded value

Bug 1276183

Change-Id: Id611a6558915a94d8686d2696094def729985bb7
Signed-off-by: Darbha Sriharsha <dsriharsha@nvidia.com>
Reviewed-on: http://git-master/r/238794
(Cherrypicked commit 9b4ed54bc194d2002a6c57087d95115938f478f3)
Reviewed-on: http://git-master/r/241973
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>

drivers/power/max77660-charger-extcon.c

index cba21b4..1206765 100644 (file)
@@ -148,7 +148,7 @@ static int max77660_charger_init(struct max77660_chg_extcon *chip, int enable)
                ret = max77660_reg_write(chip->parent,
                                MAX77660_CHG_SLAVE,
                                MAX77660_CHARGER_DCCRNT,
-                               MAX77660_DCILMT_CNTL);
+                               charger->in_current_lim);
                if (ret < 0)
                        return ret;