power: bq2419x: limit charge current for tn7c also
David Pu [Wed, 27 Nov 2013 02:58:08 +0000 (10:58 +0800)]
Bug 1410152

Change-Id: If59b02b9ca205d4a0902ae05ef9a5e50466a810b
Reviewed-on: http://git-master/r/335988
(cherry picked from commit 2cf3e2b6a3a369c170f43bcfec0cef20fb2eac37)

Signed-off-by: David Pu <dpu@nvidia.com>
Change-Id: I52568e71c019d69738385ea47064339b26c2e6ce
Reviewed-on: http://git-master/r/337152
Reviewed-by: Harry Hong <hhong@nvidia.com>
Tested-by: Harry Hong <hhong@nvidia.com>

drivers/power/bq2419x-charger.c

index bc51cb1..47db3fd 100644 (file)
@@ -230,7 +230,8 @@ static int bq2419x_init(struct bq2419x_chip *bq2419x)
        }
 
        /* Set input current limit to 2A in case of DCP */
-       if (machine_is_tegratab() && (bq2419x->in_current_limit >= 1800))
+       if ((machine_is_tegratab() || machine_is_tegranote7c()) &&
+                       (bq2419x->in_current_limit >= 1800))
                bq2419x->in_current_limit = 2000;
 
        dev_info(bq2419x->dev,
@@ -261,7 +262,7 @@ static int bq2419x_charger_init(struct bq2419x_chip *bq2419x)
 {
        int ret;
 
-       if (machine_is_tegratab()) {
+       if (machine_is_tegratab() || machine_is_tegranote7c()) {
                /* InCharge Limit=3.136A, Battery Spec is 3.2A */
                ret = regmap_write(bq2419x->regmap,
                                BQ2419X_CHRG_CTRL_REG, 0xA4);