regulator: palmas: Added regulator support for TPS80036 PMIC
Sumit Sharma [Wed, 13 Feb 2013 10:19:21 +0000 (15:19 +0530)]
Added REGEN regulator support in palmas driver for TPS80036

Change-Id: Ic65e79cdabd6b093b61fc0fe1670a59ace034088
Signed-off-by: Sumit Sharma <sumsharma@nvidia.com>
Reviewed-on: http://git-master/r/200398
(cherry picked from commit 5ccccee268d0408f09fe8d10be7474a697ef71db)
Reviewed-on: http://git-master/r/205425
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>

drivers/regulator/palmas-regulator.c

index fbc8793..90935da 100644 (file)
@@ -179,6 +179,36 @@ static const struct regs_info palmas_regs_info[] = {
                .sleep_id       = PALMAS_SLEEP_REQSTR_ID_LDO9,
        },
        {
+               .name           = "LDO10",
+               .vsel_addr      = PALMAS_LDO10_VOLTAGE,
+               .ctrl_addr      = PALMAS_LDO10_CTRL,
+               .sleep_id       = PALMAS_SLEEP_REQSTR_ID_LDO10,
+       },
+       {
+               .name           = "LDO11",
+               .vsel_addr      = PALMAS_LDO11_VOLTAGE,
+               .ctrl_addr      = PALMAS_LDO11_CTRL,
+               .sleep_id       = PALMAS_SLEEP_REQSTR_ID_LDO11,
+       },
+       {
+               .name           = "LDO12",
+               .vsel_addr      = PALMAS_LDO12_VOLTAGE,
+               .ctrl_addr      = PALMAS_LDO12_CTRL,
+               .sleep_id       = PALMAS_SLEEP_REQSTR_ID_LDO12,
+       },
+       {
+               .name           = "LDO13",
+               .vsel_addr      = PALMAS_LDO13_VOLTAGE,
+               .ctrl_addr      = PALMAS_LDO13_CTRL,
+               .sleep_id       = PALMAS_SLEEP_REQSTR_ID_LDO13,
+       },
+       {
+               .name           = "LDO14",
+               .vsel_addr      = PALMAS_LDO14_VOLTAGE,
+               .ctrl_addr      = PALMAS_LDO14_CTRL,
+               .sleep_id       = PALMAS_SLEEP_REQSTR_ID_LDO14,
+       },
+       {
                .name           = "LDOLN",
                .sname          = "ldoln-in",
                .vsel_addr      = PALMAS_LDOLN_VOLTAGE,
@@ -208,6 +238,21 @@ static const struct regs_info palmas_regs_info[] = {
                .sleep_id       = PALMAS_SLEEP_REQSTR_ID_REGEN3,
        },
        {
+               .name           = "REGEN4",
+               .ctrl_addr      = PALMAS_REGEN4_CTRL,
+               .sleep_id       = PALMAS_SLEEP_REQSTR_ID_REGEN4,
+       },
+       {
+               .name           = "REGEN5",
+               .ctrl_addr      = PALMAS_REGEN5_CTRL,
+               .sleep_id       = PALMAS_SLEEP_REQSTR_ID_REGEN5,
+       },
+       {
+               .name           = "REGEN7",
+               .ctrl_addr      = PALMAS_REGEN7_CTRL,
+               .sleep_id       = PALMAS_SLEEP_REQSTR_ID_REGEN7,
+       },
+       {
                .name           = "SYSEN1",
                .ctrl_addr      = PALMAS_SYSEN1_CTRL,
                .sleep_id       = PALMAS_SLEEP_REQSTR_ID_SYSEN1,
@@ -1206,7 +1251,15 @@ static int palmas_regulators_probe(struct platform_device *pdev)
 
        /* Start this loop from the id left from previous loop */
        for (; id < PALMAS_NUM_REGS; id++) {
-
+               if (palmas->id != TPS80036) {
+                       if (id > PALMAS_REG_LDO9 && id < PALMAS_REG_LDOLN)
+                               continue;
+                       if (id > PALMAS_REG_REGEN3 && id < PALMAS_REG_SYSEN1)
+                               continue;
+               } else {
+                       if (id == PALMAS_REG_REGEN3)
+                               continue;
+               }
                /* Miss out regulators which are not available due
                 * to alternate functions.
                 */