regulator: palmas: Clear VREF0P425 bit of LDO_CTRL
Sumit Sharma [Thu, 7 Mar 2013 13:06:28 +0000 (18:06 +0530)]
Clear VREF0P425 bit of LDO_CTRL for TPS80036 to avoid
voltage division by 2 for LDO4, LDO5 & LDO9

Change-Id: I2f8b49d25729c3d50fadf6a6700568dd3109d763
Signed-off-by: Sumit Sharma <sumsharma@nvidia.com>
Reviewed-on: http://git-master/r/207113
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

drivers/regulator/palmas-regulator.c
include/linux/mfd/palmas.h

index 90935da..e191ed3 100644 (file)
@@ -1102,6 +1102,15 @@ static int palmas_regulators_probe(struct platform_device *pdev)
        palmas->pmic = pmic;
        platform_set_drvdata(pdev, pmic);
 
+       /* Clearing VREF0P425 of LDO_CTRL register for TPS80036 */
+       if (palmas->id == TPS80036) {
+               ret = palmas_update_bits(palmas, PALMAS_LDO_BASE,
+                       PALMAS_LDO_CTRL, PALMAS_LDO_CTRL_VREF_425,
+                               ~PALMAS_LDO_CTRL_VREF_425);
+               if (ret)
+                       goto err_unregister_regulator;
+       }
+
        ret = palmas_smps_read(palmas, PALMAS_SMPS_CTRL, &reg);
        if (ret)
                return ret;
index 871f997..89f524f 100644 (file)
@@ -1331,6 +1331,8 @@ enum usb_irq_events {
 #define PALMAS_LDOUSB_VOLTAGE_VSEL_SHIFT                       0
 
 /* Bit definitions for LDO_CTRL */
+#define PALMAS_LDO_CTRL_VREF_425                               0x08
+#define PALMAS_LDO_CTRL_VREF_425_SHIFT                         3
 #define PALMAS_LDO_CTRL_LDOUSB_ON_VBUS_VSYS                    0x01
 #define PALMAS_LDO_CTRL_LDOUSB_ON_VBUS_VSYS_SHIFT              0