regulator: palmas: split SMPS10 out to two regulators
Laxman Dewangan [Thu, 5 Sep 2013 13:17:34 +0000 (18:17 +0530)]
The SMPS10 has two outputs, smps10-out1 and smps10-out2.
SMPS10-OUT1 is connected to smps10-out2 through switch and
smps10-out2 is conncted to input through boost/bypass.

As there is physically two outputs, split the SMPS10 regulator
into two regulators, smps10-out1 and smps10-out2.

Change-Id: I1dea345dcffa0e9d167d949cc69172864d331f7b
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: http://git-master/r/270870

arch/arm/mach-tegra/board-ardbeg-power.c
arch/arm/mach-tegra/board-dalmore-power.c
arch/arm/mach-tegra/board-loki-power.c
arch/arm/mach-tegra/board-macallan-power.c
arch/arm/mach-tegra/board-pluto-power.c
arch/arm/mach-tegra/board-roth-power.c
arch/arm/mach-tegra/board-tn8-power.c
drivers/regulator/palmas-regulator.c
include/linux/mfd/palmas.h

index a1d9bb0..bf4d32d 100644 (file)
@@ -482,6 +482,7 @@ static struct regulator_init_data *ardbeg_1735_reg_data[PALMAS_NUM_REGS] = {
        NULL,
        PALMAS_REG_PDATA(ti913_smps9),
        NULL,
+       NULL,
        PALMAS_REG_PDATA(ti913_ldo1),
        PALMAS_REG_PDATA(ti913_ldo2),
        PALMAS_REG_PDATA(ti913_ldo3),
@@ -517,6 +518,7 @@ static struct palmas_reg_init *ardbeg_1735_reg_init[PALMAS_NUM_REGS] = {
        NULL,
        PALMAS_REG_INIT_DATA(ti913_smps9),
        NULL,
+       NULL,
        PALMAS_REG_INIT_DATA(ti913_ldo1),
        PALMAS_REG_INIT_DATA(ti913_ldo2),
        PALMAS_REG_INIT_DATA(ti913_ldo3),
index 720bbac..7c9a4c0 100644 (file)
@@ -695,6 +695,7 @@ static struct regulator_init_data *dalmore_e1611_reg_data[PALMAS_NUM_REGS] = {
        PALMAS_REG_PDATA(smps8),
        PALMAS_REG_PDATA(smps9),
        NULL,
+       NULL,
        PALMAS_REG_PDATA(ldo1),
        PALMAS_REG_PDATA(ldo2),
        PALMAS_REG_PDATA(ldo3),
@@ -730,6 +731,7 @@ static struct palmas_reg_init *dalmore_e1611_reg_init[PALMAS_NUM_REGS] = {
        PALMAS_REG_INIT_DATA(smps8),
        PALMAS_REG_INIT_DATA(smps9),
        NULL,
+       NULL,
        PALMAS_REG_INIT_DATA(ldo1),
        PALMAS_REG_INIT_DATA(ldo2),
        PALMAS_REG_INIT_DATA(ldo3),
index 51e1d14..1d9b455 100644 (file)
@@ -98,7 +98,7 @@ static struct regulator_consumer_supply palmas_smps9_supply[] = {
        REGULATOR_SUPPLY("vddio_sd_slot", "sdhci-tegra.3"),
 };
 
-static struct regulator_consumer_supply palmas_smps10_supply[] = {
+static struct regulator_consumer_supply palmas_smps10_out1_supply[] = {
        REGULATOR_SUPPLY("vdd_5v0_cam", NULL),
        REGULATOR_SUPPLY("spkvdd", "tegra-snd-rt5639.0"),
        REGULATOR_SUPPLY("spkvdd", "tegra-snd-rt5645.0"),
@@ -201,7 +201,7 @@ PALMAS_REGS_PDATA(smps8, 1800,  1800, NULL, 1, 1, 1, NORMAL,
                0, 0, 0, 0, 0);
 PALMAS_REGS_PDATA(smps9, 2800,  2800, NULL, 0, 0, 1, NORMAL,
                0, 0, 0, 0, 0);
-PALMAS_REGS_PDATA(smps10, 5000,  5000, NULL, 1, 1, 1, 0,
+PALMAS_REGS_PDATA(smps10_out1, 5000,  5000, NULL, 1, 1, 1, 0,
                0, 0, 0, 0, 0);
 PALMAS_REGS_PDATA(ldo1, 1050,  1050, NULL, 0, 0, 1, 0,
                0, 0, 0, 0, 0);
@@ -240,7 +240,8 @@ static struct regulator_init_data *loki_reg_data[PALMAS_NUM_REGS] = {
        PALMAS_REG_PDATA(smps7),
        PALMAS_REG_PDATA(smps8),
        PALMAS_REG_PDATA(smps9),
-       PALMAS_REG_PDATA(smps10),
+       NULL,
+       PALMAS_REG_PDATA(smps10_out1),
        PALMAS_REG_PDATA(ldo1),
        PALMAS_REG_PDATA(ldo2),
        PALMAS_REG_PDATA(ldo3),
@@ -275,7 +276,8 @@ static struct palmas_reg_init *loki_reg_init[PALMAS_NUM_REGS] = {
        PALMAS_REG_INIT_DATA(smps7),
        PALMAS_REG_INIT_DATA(smps8),
        PALMAS_REG_INIT_DATA(smps9),
-       PALMAS_REG_INIT_DATA(smps10),
+       NULL,
+       PALMAS_REG_INIT_DATA(smps10_out1),
        PALMAS_REG_INIT_DATA(ldo1),
        PALMAS_REG_INIT_DATA(ldo2),
        PALMAS_REG_INIT_DATA(ldo3),
@@ -564,7 +566,7 @@ FIXED_REG(0,        battery,        battery,        NULL,
        0,      0,      -1,
        false,  true,   0,      3300, 0);
 
-FIXED_REG(1,   modem_3v3,      modem_3v3,      palmas_rails(smps10),
+FIXED_REG(1,   modem_3v3,      modem_3v3,      palmas_rails(smps10_out1),
        0,      0,      TEGRA_GPIO_PS2,
        false,  true,   0,      3700,   0);
 
index e806912..3c8354c 100644 (file)
@@ -175,7 +175,7 @@ static struct regulator_consumer_supply palmas_smps9_supply[] = {
        REGULATOR_SUPPLY("pwrdet_hv", NULL),
 };
 
-static struct regulator_consumer_supply palmas_smps10_supply[] = {
+static struct regulator_consumer_supply palmas_smps10_out1_supply[] = {
 };
 
 static struct regulator_consumer_supply palmas_ldo1_supply[] = {
@@ -280,7 +280,7 @@ PALMAS_REGS_PDATA(smps8, 1800,  1800, NULL, 1, 1, 1, NORMAL,
        0, 0, 0, 0, 0);
 PALMAS_REGS_PDATA(smps9, 2900,  2900, NULL, 1, 0, 1, NORMAL,
        0, 0, 0, 0, 0);
-PALMAS_REGS_PDATA(smps10, 5000,  5000, NULL, 0, 0, 0, 0,
+PALMAS_REGS_PDATA(smps10_out1, 5000,  5000, NULL, 0, 0, 0, 0,
        0, 0, 0, 0, 0);
 PALMAS_REGS_PDATA(ldo1, 1050,  1050, palmas_rails(smps7), 1, 0, 1, 0,
        0, PALMAS_EXT_CONTROL_NSLEEP, 0, 0, 0);
@@ -320,7 +320,8 @@ static struct regulator_init_data *macallan_reg_data[PALMAS_NUM_REGS] = {
        PALMAS_REG_PDATA(smps7),
        PALMAS_REG_PDATA(smps8),
        PALMAS_REG_PDATA(smps9),
-       PALMAS_REG_PDATA(smps10),
+       NULL,
+       PALMAS_REG_PDATA(smps10_out1),
        PALMAS_REG_PDATA(ldo1),
        PALMAS_REG_PDATA(ldo2),
        PALMAS_REG_PDATA(ldo3),
@@ -350,7 +351,8 @@ static struct palmas_reg_init *macallan_reg_init[PALMAS_NUM_REGS] = {
        PALMAS_REG_INIT_DATA(smps7),
        PALMAS_REG_INIT_DATA(smps8),
        PALMAS_REG_INIT_DATA(smps9),
-       PALMAS_REG_INIT_DATA(smps10),
+       NULL,
+       PALMAS_REG_INIT_DATA(smps10_out1),
        PALMAS_REG_INIT_DATA(ldo1),
        PALMAS_REG_INIT_DATA(ldo2),
        PALMAS_REG_INIT_DATA(ldo3),
@@ -502,7 +504,7 @@ FIXED_REG(3,        dvdd_ts,        dvdd_ts,
        TEGRA_GPIO_PH4, false,  false,  1,      1800);
 
 FIXED_REG(4,   vdd_hdmi_5v0,   vdd_hdmi_5v0,
-       palmas_rails(smps10),   0,      0,
+       palmas_rails(smps10_out1),      0,      0,
        TEGRA_GPIO_PK6, true,   true,   0,      5000);
 
 FIXED_REG(5,   vddio_sd_slot,  vddio_sd_slot,
index a02e17f..265435d 100644 (file)
@@ -128,8 +128,7 @@ static struct regulator_consumer_supply palmas_smps9_supply[] = {
        REGULATOR_SUPPLY("vdd_sim1b_mmc", NULL),
 };
 
-static struct regulator_consumer_supply palmas_smps10_supply[] = {
-       REGULATOR_SUPPLY("unused_smps10", NULL),
+static struct regulator_consumer_supply palmas_smps10_out1_supply[] = {
        REGULATOR_SUPPLY("usb_vbus", "tegra-ehci.0"),
        REGULATOR_SUPPLY("usb_vbus", "tegra-otg"),
        REGULATOR_SUPPLY("avddio_usb", "tegra-xhci"),
@@ -261,7 +260,7 @@ PALMAS_REGS_PDATA(smps8, 1800,  1800, NULL, 1, 1, 1, NORMAL,
                0, 0, 0, 0, 0);
 PALMAS_REGS_PDATA(smps9, 2800,  2800, NULL, 1, 0, 1, NORMAL,
                0, 0, 0, 0, 0);
-PALMAS_REGS_PDATA(smps10, 5000,  5000, NULL, 0, 0, 0, 0,
+PALMAS_REGS_PDATA(smps10_out1, 5000,  5000, NULL, 0, 0, 0, 0,
                0, 0, 0, 0, 0);
 PALMAS_REGS_PDATA(ldo1, 1050,  1050, palmas_rails(smps7), 0, 0, 1, 0,
                0, PALMAS_EXT_CONTROL_NSLEEP, 0, 0, 0);
@@ -301,7 +300,8 @@ static struct regulator_init_data *pluto_reg_data[PALMAS_NUM_REGS] = {
        PALMAS_REG_PDATA(smps7),
        PALMAS_REG_PDATA(smps8),
        PALMAS_REG_PDATA(smps9),
-       PALMAS_REG_PDATA(smps10),
+       NULL,
+       PALMAS_REG_PDATA(smps10_out1),
        PALMAS_REG_PDATA(ldo1),
        PALMAS_REG_PDATA(ldo2),
        PALMAS_REG_PDATA(ldo3),
@@ -336,7 +336,8 @@ static struct palmas_reg_init *pluto_reg_init[PALMAS_NUM_REGS] = {
        PALMAS_REG_INIT_DATA(smps7),
        PALMAS_REG_INIT_DATA(smps8),
        PALMAS_REG_INIT_DATA(smps9),
-       PALMAS_REG_INIT_DATA(smps10),
+       NULL,
+       PALMAS_REG_INIT_DATA(smps10_out1),
        PALMAS_REG_INIT_DATA(ldo1),
        PALMAS_REG_INIT_DATA(ldo2),
        PALMAS_REG_INIT_DATA(ldo3),
index 735050b..0a24516 100644 (file)
@@ -209,7 +209,7 @@ static struct regulator_consumer_supply palmas_smps9_supply[] = {
        REGULATOR_SUPPLY("vddio_sd_slot", "sdhci-tegra.3"),
 };
 
-static struct regulator_consumer_supply palmas_smps10_supply[] = {
+static struct regulator_consumer_supply palmas_smps10_out2_supply[] = {
        REGULATOR_SUPPLY("vdd_vbrtr", NULL),
        REGULATOR_SUPPLY("vdd_5v0", NULL),
 };
@@ -278,7 +278,7 @@ PALMAS_PDATA_INIT(smps45, 900,  1400, NULL, 1, 1, 0, NORMAL);
 PALMAS_PDATA_INIT(smps457, 900,  1400, NULL, 1, 1, 0, NORMAL);
 PALMAS_PDATA_INIT(smps8, 1050,  1050, NULL, 1, 1, 1, NORMAL);
 PALMAS_PDATA_INIT(smps9, 2800,  2800, NULL, 0, 0, 0, NORMAL);
-PALMAS_PDATA_INIT(smps10, 5000,  5000, NULL, 0, 0, 0, 0);
+PALMAS_PDATA_INIT(smps10_out2, 5000,  5000, NULL, 0, 0, 0, 0);
 PALMAS_PDATA_INIT(ldo2, 2800,  2800, NULL, 0, 0, 1, 0);
 PALMAS_PDATA_INIT(ldo3, 1200,  1200, NULL, 1, 1, 1, 0);
 PALMAS_PDATA_INIT(ldo4, 1800,  1800, NULL, 0, 0, 1, 0);
@@ -301,7 +301,8 @@ static struct regulator_init_data *roth_reg_data[PALMAS_NUM_REGS] = {
        NULL,
        PALMAS_REG_PDATA(smps8),
        PALMAS_REG_PDATA(smps9),
-       PALMAS_REG_PDATA(smps10),
+       PALMAS_REG_PDATA(smps10_out2),
+       NULL,
        NULL,   /* LDO1 */
        PALMAS_REG_PDATA(ldo2),
        PALMAS_REG_PDATA(ldo3),
@@ -343,7 +344,7 @@ PALMAS_REG_INIT(smps6, 0, 0, 0, 0);
 PALMAS_REG_INIT(smps7, 0, 0, 0, 0);
 PALMAS_REG_INIT(smps8, 0, 0, 0, 0);
 PALMAS_REG_INIT(smps9, 0, 0, 0, 0);
-PALMAS_REG_INIT(smps10, 0, 0, 0, 0);
+PALMAS_REG_INIT(smps10_out2, 0, 0, 0, 0);
 PALMAS_REG_INIT(ldo1, 0, 0, 0, 0);
 PALMAS_REG_INIT(ldo2, 0, 0, 0, 0);
 PALMAS_REG_INIT(ldo3, 0, 0, 0, 0);
@@ -372,7 +373,8 @@ static struct palmas_reg_init *roth_reg_init[PALMAS_NUM_REGS] = {
        PALMAS_REG_INIT_DATA(smps7),
        PALMAS_REG_INIT_DATA(smps8),
        PALMAS_REG_INIT_DATA(smps9),
-       PALMAS_REG_INIT_DATA(smps10),
+       PALMAS_REG_INIT_DATA(smps10_out2),
+       NULL,
        PALMAS_REG_INIT_DATA(ldo1),
        PALMAS_REG_INIT_DATA(ldo2),
        PALMAS_REG_INIT_DATA(ldo3),
@@ -519,11 +521,11 @@ static struct regulator_consumer_supply fixed_reg_dvdd_lcd_supply[] = {
        }
 
 FIXED_REG(0,   fan_5v0,        fan_5v0,
-       palmas_rails(smps10),   0,      0,
+       palmas_rails(smps10_out2),      0,      0,
        PALMAS_TEGRA_GPIO_BASE + PALMAS_GPIO6,  false,  true,   0,      5000);
 
 FIXED_REG(1,   vdd_hdmi_5v0,   vdd_hdmi_5v0,
-       palmas_rails(smps10),   0,      0,
+       palmas_rails(smps10_out2),      0,      0,
        TEGRA_GPIO_PK1, false,  true,   0,      5000);
 
 FIXED_REG(2,   lcd_bl_en,      lcd_bl_en,
index b2c72c9..1596f31 100644 (file)
@@ -149,7 +149,7 @@ static struct regulator_consumer_supply palmas_smps9_supply[] = {
        REGULATOR_SUPPLY("vdd", "1-004d"),
 };
 
-static struct regulator_consumer_supply palmas_smps10_supply[] = {
+static struct regulator_consumer_supply palmas_smps10_out2_supply[] = {
        REGULATOR_SUPPLY("vdd_5v0_mdm", NULL),
        REGULATOR_SUPPLY("vdd_5v0_snsr", NULL),
        REGULATOR_SUPPLY("vdd_5v0_dis", NULL),
@@ -264,7 +264,7 @@ PALMAS_REGS_PDATA(smps8, 1800, 1800, NULL, 1, 1, 1, NORMAL,
        0, 0, 0, 0, 0);
 PALMAS_REGS_PDATA(smps9, 3300, 3300, NULL, 0, 0, 1, NORMAL,
        0, 0, 0, 0, 0);
-PALMAS_REGS_PDATA(smps10, 5000, 5000, NULL, 0, 0, 1, 0,
+PALMAS_REGS_PDATA(smps10_out2, 5000, 5000, NULL, 0, 0, 1, 0,
        0, 0, 0, 0, 0);
 PALMAS_REGS_PDATA(ldo1, 1050, 1050, palmas_rails(smps6), 1, 1, 1, 0,
        0, PALMAS_EXT_CONTROL_NSLEEP, 0, 0, 0);
@@ -284,7 +284,7 @@ PALMAS_REGS_PDATA(ldo8, 1000, 1000, NULL, 1, 1, 1, 0,
        0, 0, 0, 0, 0);
 PALMAS_REGS_PDATA(ldo9, 1800, 3300, palmas_rails(smps9), 0, 0, 1, 0,
        0, 0, 0, 0, 0);
-PALMAS_REGS_PDATA(ldoln, 3300, 3300, palmas_rails(smps10), 1, 1, 1, 0,
+PALMAS_REGS_PDATA(ldoln, 3300, 3300, palmas_rails(smps10_out2), 1, 1, 1, 0,
        0, 0, 0, 0, 0);
 PALMAS_REGS_PDATA(ldousb, 3000, 3300, NULL, 1, 1, 1, 0,
        0, 0, 0, 0, 0);
@@ -300,7 +300,8 @@ static struct regulator_init_data *tn8_reg_data[PALMAS_NUM_REGS] = {
        PALMAS_REG_PDATA(smps7),
        PALMAS_REG_PDATA(smps8),
        PALMAS_REG_PDATA(smps9),
-       PALMAS_REG_PDATA(smps10),
+       PALMAS_REG_PDATA(smps10_out2),
+       NULL,
        PALMAS_REG_PDATA(ldo1),
        PALMAS_REG_PDATA(ldo2),
        PALMAS_REG_PDATA(ldo3),
@@ -335,7 +336,8 @@ static struct palmas_reg_init *tn8_reg_init[PALMAS_NUM_REGS] = {
        PALMAS_REG_INIT_DATA(smps7),
        PALMAS_REG_INIT_DATA(smps8),
        PALMAS_REG_INIT_DATA(smps9),
-       PALMAS_REG_INIT_DATA(smps10),
+       PALMAS_REG_INIT_DATA(smps10_out2),
+       NULL,
        PALMAS_REG_INIT_DATA(ldo1),
        PALMAS_REG_INIT_DATA(ldo2),
        PALMAS_REG_INIT_DATA(ldo3),
@@ -567,11 +569,11 @@ FIXED_REG(1,      usb0_vbus,      usb0_vbus,      NULL,
        0,      0,      TEGRA_GPIO_PN4,
        true,   true,   0,      5000,   0);
 
-FIXED_REG(2,   usb1_vbus,      usb1_vbus,      palmas_rails(smps10),
+FIXED_REG(2,   usb1_vbus,      usb1_vbus,      palmas_rails(smps10_out2),
        0,      0,      TEGRA_GPIO_PN5,
        true,   true,   0,      5000,   0);
 
-FIXED_REG(3,   usb2_vbus,      usb2_vbus,      palmas_rails(smps10),
+FIXED_REG(3,   usb2_vbus,      usb2_vbus,      palmas_rails(smps10_out2),
        0,      0,      TEGRA_GPIO_PFF1,
        true,   true,   0,      5000,   0);
 
@@ -595,7 +597,7 @@ FIXED_REG(8,        lcd_bl_en,      lcd_bl_en, NULL,
        0,      0, TEGRA_GPIO_PH2,
        false,  true,   0,      5000,   0);
 
-FIXED_REG(9,   vdd_hdmi_5v0,   vdd_hdmi_5v0, palmas_rails(smps10),
+FIXED_REG(9,   vdd_hdmi_5v0,   vdd_hdmi_5v0, palmas_rails(smps10_out2),
        0,      0, TEGRA_GPIO_PK6,
        false,  true,   0,      5000,   0);
 
index 5ec7422..7506731 100644 (file)
@@ -118,7 +118,13 @@ static const struct regs_info palmas_regs_info[] = {
                .sleep_id       = PALMAS_SLEEP_REQSTR_ID_SMPS9,
        },
        {
-               .name           = "SMPS10",
+               .name           = "SMPS10_OUT2",
+               .sname          = "smps10-in",
+               .ctrl_addr      = PALMAS_SMPS10_CTRL,
+               .sleep_id       = PALMAS_SLEEP_REQSTR_ID_SMPS10,
+       },
+       {
+               .name           = "SMPS10_OUT1",
                .sname          = "smps10-in",
                .ctrl_addr      = PALMAS_SMPS10_CTRL,
                .sleep_id       = PALMAS_SLEEP_REQSTR_ID_SMPS10,
@@ -305,9 +311,6 @@ static unsigned int palmas_smps_ramp_delay[4] = {0, 10000, 5000, 2500};
 
 #define REGULATOR_SLAVE                        0
 
-static void palmas_disable_smps10_boost(struct palmas *palmas);
-static void palmas_enable_smps10_boost(struct palmas *palmas);
-
 static int palmas_smps_read(struct palmas *palmas, unsigned int reg,
                unsigned int *dest)
 {
@@ -618,58 +621,16 @@ static struct regulator_ops palmas_ops_smps = {
        .set_ramp_delay         = palmas_smps_set_ramp_delay,
 };
 
-static int palmas_is_enabled_smps10(struct regulator_dev *dev)
-{
-       struct palmas_pmic *pmic = rdev_get_drvdata(dev);
-       int id = rdev_get_id(dev);
-
-       if (EXT_PWR_REQ & pmic->roof_floor[id])
-               return true;
-
-       return regulator_is_enabled_regmap(dev);
-}
-
-static int palmas_enable_smps10(struct regulator_dev *dev)
-{
-       struct palmas_pmic *pmic = rdev_get_drvdata(dev);
-       int id = rdev_get_id(dev);
-       int ret = 0;
-
-       if (!(EXT_PWR_REQ & pmic->roof_floor[id]))
-               ret = regulator_enable_regmap(dev);
-
-       palmas_enable_smps10_boost(pmic->palmas);
-       pmic->smps10_regulator_enabled = true;
-       return ret;
-}
-
-static int palmas_disable_smps10(struct regulator_dev *dev)
-{
-       struct palmas_pmic *pmic = rdev_get_drvdata(dev);
-       int id = rdev_get_id(dev);
-       int ret = 0;
-       
-       if (!(EXT_PWR_REQ & pmic->roof_floor[id]))
-               ret = regulator_disable_regmap(dev);
-
-       pmic->smps10_regulator_enabled = false;
-
-       if (pmic->smps10_boost_disable_deferred) {
-               palmas_disable_smps10_boost(pmic->palmas);
-               pmic->smps10_boost_disable_deferred = false;
-       }
-
-       return ret;
-}
-
 static struct regulator_ops palmas_ops_smps10 = {
-       .is_enabled             = palmas_is_enabled_smps10,
-       .enable                 = palmas_enable_smps10,
-       .disable                = palmas_disable_smps10,
+       .is_enabled             = regulator_is_enabled_regmap,
+       .enable                 = regulator_enable_regmap,
+       .disable                = regulator_disable_regmap,
        .get_voltage_sel        = regulator_get_voltage_sel_regmap,
        .set_voltage_sel        = regulator_set_voltage_sel_regmap,
        .list_voltage           = regulator_list_voltage_linear,
        .map_voltage            = regulator_map_voltage_linear,
+       .set_bypass             = regulator_set_bypass_regmap,
+       .get_bypass             = regulator_get_bypass_regmap,
 };
 
 static int palmas_ldo_enable_time(struct regulator_dev *dev)
@@ -794,45 +755,6 @@ static int palmas_ldo5_tracking_init(struct palmas *palmas,
        return 0;
 }
 
-static void palmas_disable_smps10_boost(struct palmas *palmas)
-{
-       unsigned int addr;
-       int ret;
-
-       addr = palmas_regs_info[PALMAS_REG_SMPS10].ctrl_addr;
-
-       ret = palmas_smps_write(palmas, addr, 0x00);
-       if (ret < 0) {
-               dev_err(palmas->dev, "Error in disabling smps10 boost\n");
-               return;
-       }
-
-}
-
-static void palmas_enable_smps10_boost(struct palmas *palmas)
-{
-       unsigned int reg;
-       unsigned int addr;
-       int ret;
-
-       addr = palmas_regs_info[PALMAS_REG_SMPS10].ctrl_addr;
-
-       ret = palmas_smps_read(palmas, addr, &reg);
-       if (ret) {
-               dev_err(palmas->dev, "Error in reading smps10 control reg\n");
-               return;
-       }
-
-       reg |= SMPS10_VSEL;
-       reg |= SMPS10_BOOST_EN;
-
-       ret = palmas_smps_write(palmas, addr, reg);
-       if (ret < 0) {
-               dev_err(palmas->dev, "Error in disabling smps10 boost\n");
-               return;
-       }
-}
-
 static void palmas_enable_ldo8_track(struct palmas *palmas)
 {
        unsigned int reg;
@@ -981,7 +903,8 @@ static int palmas_smps_init(struct palmas *palmas, int id,
                return ret;
 
        switch (id) {
-       case PALMAS_REG_SMPS10:
+       case PALMAS_REG_SMPS10_OUT1:
+       case PALMAS_REG_SMPS10_OUT2:
                reg &= ~PALMAS_SMPS10_CTRL_MODE_SLEEP_MASK;
                if (reg_init->mode_sleep)
                        reg |= reg_init->mode_sleep <<
@@ -1002,13 +925,16 @@ static int palmas_smps_init(struct palmas *palmas, int id,
                if (reg_init->mode_sleep)
                        reg |= reg_init->mode_sleep <<
                                        PALMAS_SMPS12_CTRL_MODE_SLEEP_SHIFT;
+               break;
        }
 
        ret = palmas_smps_write(palmas, addr, reg);
        if (ret)
                return ret;
 
-       if ((id != PALMAS_REG_SMPS10) && reg_init->roof_floor) {
+       if ((id != PALMAS_REG_SMPS10_OUT1) &&
+                       (id != PALMAS_REG_SMPS10_OUT2) &&
+                       reg_init->roof_floor) {
                int sleep_id = palmas_regs_info[id].sleep_id;
                ret = palmas_ext_power_req_config(palmas, sleep_id,
                                        reg_init->roof_floor, true);
@@ -1496,7 +1422,8 @@ static int palmas_regulators_probe(struct platform_device *pdev)
                pmic->desc[id].id = id;
 
                switch (id) {
-               case PALMAS_REG_SMPS10:
+               case PALMAS_REG_SMPS10_OUT1:
+               case PALMAS_REG_SMPS10_OUT2:
                        pmic->desc[id].n_voltages = PALMAS_SMPS10_NUM_VOLTAGES;
                        pmic->desc[id].ops = &palmas_ops_smps10;
                        pmic->desc[id].vsel_reg =
@@ -1506,7 +1433,14 @@ static int palmas_regulators_probe(struct platform_device *pdev)
                        pmic->desc[id].enable_reg =
                                        PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE,
                                                        PALMAS_SMPS10_CTRL);
-                       pmic->desc[id].enable_mask = SMPS10_BOOST_EN;
+                       if (id == PALMAS_REG_SMPS10_OUT1)
+                               pmic->desc[id].enable_mask = SMPS10_SWITCH_EN;
+                       else
+                               pmic->desc[id].enable_mask = SMPS10_BOOST_EN;
+                       pmic->desc[id].bypass_reg =
+                                       PALMAS_BASE_TO_REG(PALMAS_SMPS_BASE,
+                                                       PALMAS_SMPS10_CTRL);
+                       pmic->desc[id].bypass_mask = SMPS10_BYPASS_EN;
                        pmic->desc[id].min_uV = 3750000;
                        pmic->desc[id].uV_step = 1250000;
                        break;
@@ -1540,6 +1474,7 @@ static int palmas_regulators_probe(struct platform_device *pdev)
                                goto err_unregister_regulator;
                        pmic->current_reg_mode[id] = reg &
                                        PALMAS_SMPS12_CTRL_MODE_ACTIVE_MASK;
+                       break;
                }
 
                pmic->desc[id].type = REGULATOR_VOLTAGE;
@@ -1731,16 +1666,8 @@ static int palmas_suspend(struct device *dev)
 {
        struct palmas *palmas = dev_get_drvdata(dev->parent);
        struct palmas_pmic *pmic = dev_get_drvdata(dev);
-       struct palmas_pmic_platform_data *pdata = dev_get_platdata(dev);
        int id;
 
-       if (pdata->disable_smps10_boost_suspend) {
-               if (!pmic->smps10_regulator_enabled)
-                       palmas_disable_smps10_boost(palmas);
-               else
-                       pmic->smps10_boost_disable_deferred = true;
-       }
-
        for (id = 0; id < PALMAS_NUM_REGS; id++) {
                unsigned int cf = pmic->config_flags[id];
 
@@ -1763,13 +1690,8 @@ static int palmas_resume(struct device *dev)
 {
        struct palmas *palmas = dev_get_drvdata(dev->parent);
        struct palmas_pmic *pmic = dev_get_drvdata(dev);
-       struct palmas_pmic_platform_data *pdata = dev_get_platdata(dev);
        int id;
 
-       if (pdata->disable_smps10_boost_suspend &&
-                       !pmic->smps10_regulator_enabled)
-               palmas_enable_smps10_boost(palmas);
-
        for (id = 0; id < PALMAS_NUM_REGS; id++) {
                unsigned int cf = pmic->config_flags[id];
 
index 5da9b42..38de6d7 100644 (file)
@@ -367,7 +367,8 @@ enum palmas_regulators {
        PALMAS_REG_SMPS7,
        PALMAS_REG_SMPS8,
        PALMAS_REG_SMPS9,
-       PALMAS_REG_SMPS10,
+       PALMAS_REG_SMPS10_OUT2,
+       PALMAS_REG_SMPS10_OUT1,
        /* LDO regulators */
        PALMAS_REG_LDO1,
        PALMAS_REG_LDO2,
@@ -702,10 +703,10 @@ struct palmas_pmic {
        int ldo_vref0p425;
        bool smps10_boost_disable_deferred;
 
-       int range[PALMAS_REG_SMPS10];
-       unsigned int ramp_delay[PALMAS_REG_SMPS10];
+       int range[PALMAS_REG_SMPS10_OUT1];
+       unsigned int ramp_delay[PALMAS_REG_SMPS10_OUT1];
        bool ramp_delay_support[PALMAS_NUM_REGS];
-       unsigned int current_reg_mode[PALMAS_REG_SMPS10];
+       unsigned int current_reg_mode[PALMAS_REG_SMPS10_OUT1];
        unsigned long roof_floor[PALMAS_NUM_REGS];
        unsigned long config_flags[PALMAS_NUM_REGS];
 };