]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
regulator: max8973: enable EN bit during dcdc initialization
authorKerwin Wan <kerwinw@nvidia.com>
Fri, 29 Aug 2014 20:59:24 +0000 (13:59 -0700)
committerSeema Khowala <seemaj@nvidia.com>
Thu, 4 Sep 2014 18:30:42 +0000 (11:30 -0700)
The EN bit on VOUT regsiters is ANDed with external EN pin on MAX77621
and ORed with MAX8973.
Implement the same for external control.

Change-Id: I1ed4818cc34fe43f9726e280669fa51cc042d9a6
Signed-off-by: Kerwin Wan <kerwinw@nvidia.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/495451

drivers/regulator/max8973-regulator.c

index 66b2a16f1f4f6c027bfef2aa14a66741a28609a7..0777823fd371a2848edeb8efaf751f130c5eae9e 100644 (file)
@@ -427,10 +427,16 @@ static int max8973_init_dcdc(struct max8973_chip *max,
                return ret;
        }
 
-       /* If external control is enabled then disable EN bit */
+       /* MAX8973: EN pin is ORed with EN bit.
+        * MAX77621: EN pin is ANDed with shutdown.
+        */
        if (max->enable_external_control) {
+               int en_bit = 0;
+               if (max->id == MAX77621)
+                       en_bit = MAX8973_VOUT_ENABLE;
+
                ret = regmap_update_bits(max->regmap, MAX8973_VOUT,
-                                               MAX8973_VOUT_ENABLE, 0);
+                                       MAX8973_VOUT_ENABLE, en_bit);
                if (ret < 0)
                        dev_err(max->dev, "register %d update failed, err = %d",
                                MAX8973_VOUT, ret);