]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
power: bq2419x:update charge control registers
authorVenkat Reddy Talla <vreddytalla@nvidia.com>
Fri, 8 Nov 2013 10:46:34 +0000 (16:16 +0530)
committerVenkat Reddy Talla <vreddytalla@nvidia.com>
Tue, 19 Nov 2013 04:05:23 +0000 (20:05 -0800)
update charge control registers of BQ2419x.
Bug 1402856

Change-Id: If11c38465abbcdf6df6b087b07f9f00ffca66470
Signed-off-by: Venkat Reddy Talla <vreddytalla@nvidia.com>
Reviewed-on: http://git-master/r/328233
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
drivers/power/bq2419x-charger.c

index 432b8b246a22713af8367e14f87f5ae1ffe7ab7e..ecbb4b9313836d20f0359797c7912027d7050144 100644 (file)
@@ -172,17 +172,27 @@ static int bq2419x_charger_init(struct bq2419x_chip *bq2419x)
        int ret;
 
        /* Configure Output Current Control to 2.25A*/
-       ret = regmap_write(bq2419x->regmap, BQ2419X_CHRG_CTRL_REG, 0x6c);
+       ret = regmap_write(bq2419x->regmap, BQ2419X_CHRG_CTRL_REG, 0xFC);
        if (ret < 0) {
                dev_err(bq2419x->dev, "CHRG_CTRL_REG write failed %d\n", ret);
                return ret;
        }
 
+       /*
+        * Configure Pre-charge current limit to 768mA,
+        * and Termination current limit to 384mA.
+       */
+       ret = regmap_write(bq2419x->regmap, BQ2419X_CHRG_TERM_REG, 0x52);
+       if (ret < 0) {
+               dev_err(bq2419x->dev, "CHRG_TERM_REG write failed %d\n", ret);
+               return ret;
+       }
+
        /*
         * Configure Input voltage limit reset to OTP value,
         * and charging current to 500mA.
         */
-       ret = regmap_write(bq2419x->regmap, BQ2419X_INPUT_SRC_REG, 0x32);
+       ret = regmap_write(bq2419x->regmap, BQ2419X_INPUT_SRC_REG, 0x22);
        if (ret < 0)
                dev_err(bq2419x->dev, "INPUT_SRC_REG write failed %d\n", ret);
 
@@ -196,15 +206,9 @@ static int bq2419x_configure_charging_current(struct bq2419x_chip *bq2419x,
        int ret = 0;
        int floor = 0;
 
-       /* Configure input voltage to 4.52 in case of NV charger */
-       if (in_current_limit == 2000)
-               val |= BQ2419x_NVCHARGER_INPUT_VOL_SEL;
-       else
-               val |= BQ2419x_DEFAULT_INPUT_VOL_SEL;
-
        /* Clear EN_HIZ */
        ret = regmap_update_bits(bq2419x->regmap, BQ2419X_INPUT_SRC_REG,
-                       BQ2419X_EN_HIZ | BQ2419x_INPUT_VOLTAGE_MASK, val);
+                       BQ2419X_EN_HIZ, 0);
        if (ret < 0) {
                dev_err(bq2419x->dev, "INPUT_SRC_REG update failed %d\n", ret);
                return ret;