]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00170788 MX6Q PFUZE100:configure VDDARM and VDDSOC voltage in standby
authorRobin Gong <B38343@freescale.com>
Wed, 21 Dec 2011 11:13:59 +0000 (19:13 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:10:24 +0000 (14:10 +0200)
Configure register 33&40&47 to set standby voltage of SW1A/1B/1C

Signed-off-by: Robin Gong <B38343@freescale.com>
drivers/regulator/pfuze100-regulator.c

index afa24ab454f63492cbc45266a241042ab7852d1f..2cd755aab111ef366e20355c13908d22fd1d30bb 100644 (file)
@@ -168,7 +168,7 @@ static struct regulator_ops pfuze100_sw_regulator_ops;
 #define PFUZE100_SW1AVOL_VSEL_M        (0x3f<<0)
 
 #define PFUZE100_SW1ASTANDBY   33
-#define PFUZE100_SW1ASTANDBY_STBY_VAL  (0x0)
+#define PFUZE100_SW1ASTANDBY_STBY_VAL  (0x14)
 #define PFUZE100_SW1ASTANDBY_STBY_M    (0x3f<<0)
 
 #define PFUZE100_SW1AOFF       34
@@ -197,7 +197,7 @@ static struct regulator_ops pfuze100_sw_regulator_ops;
 #define PFUZE100_SW1BVOL_VSEL_M        (0x3f<<0)
 
 #define PFUZE100_SW1BSTANDBY   40
-#define PFUZE100_SW1BSTANDBY_STBY_VAL  0x0
+#define PFUZE100_SW1BSTANDBY_STBY_VAL  (0x14)
 #define PFUZE100_SW1BSTANDBY_STBY_M    (0x3f<<0)
 
 #define PFUZE100_SW1BOFF       41
@@ -226,7 +226,7 @@ static struct regulator_ops pfuze100_sw_regulator_ops;
 #define PFUZE100_SW1CVOL_VSEL_M        (0x3f<<0)
 
 #define PFUZE100_SW1CSTANDBY   47
-#define PFUZE100_SW1CSTANDBY_STBY_VAL  0x0
+#define PFUZE100_SW1CSTANDBY_STBY_VAL  (0x14)
 #define PFUZE100_SW1CSTANDBY_STBY_M    (0x3f<<0)
 
 #define PFUZE100_SW1COFF       48
@@ -634,7 +634,7 @@ static int __devinit pfuze100_regulator_probe(struct platform_device *pdev)
            dev_get_platdata(&pdev->dev);
        struct pfuze_regulator_init_data *init_data;
        int i, ret;
-       struct regulator *test_regulator;
+       struct regulator *enabled_regulator;
 
        priv = kzalloc(sizeof(*priv) +
                       pdata->num_regulators * sizeof(priv->regulators[0]),
@@ -649,6 +649,21 @@ static int __devinit pfuze100_regulator_probe(struct platform_device *pdev)
                            PFUZE100_SWBSTCON1_SWBSTMOD_VAL);
        if (ret)
                goto err_free;
+       ret = pfuze_reg_rmw(pfuze100, PFUZE100_SW1ASTANDBY,
+                           PFUZE100_SW1ASTANDBY_STBY_M,
+                           PFUZE100_SW1ASTANDBY_STBY_VAL);
+       if (ret)
+               goto err_free;
+       ret = pfuze_reg_rmw(pfuze100, PFUZE100_SW1BSTANDBY,
+                           PFUZE100_SW1BSTANDBY_STBY_M,
+                           PFUZE100_SW1BSTANDBY_STBY_VAL);
+       if (ret)
+               goto err_free;
+       ret = pfuze_reg_rmw(pfuze100, PFUZE100_SW1CSTANDBY,
+                           PFUZE100_SW1CSTANDBY_STBY_M,
+                           PFUZE100_SW1CSTANDBY_STBY_VAL);
+       if (ret)
+               goto err_free;
        pfuze_unlock(pfuze100);
        for (i = 0; i < pdata->num_regulators; i++) {
                init_data = &pdata->regulators[i];
@@ -662,13 +677,14 @@ static int __devinit pfuze100_regulator_probe(struct platform_device *pdev)
                        goto err;
                }
        }
+
+       enabled_regulator = regulator_get(&pdev->dev, "P1V325_VDDARM_SW1AB");
+       if (enabled_regulator)
+               regulator_set_voltage(enabled_regulator, 1325000, 1325000);
+       enabled_regulator = regulator_get(&pdev->dev, "P1V325_VDDSOC_SW1C");
+       if (enabled_regulator)
+               regulator_set_voltage(enabled_regulator, 1325000, 1325000);
 #if 0
-       test_regulator = regulator_get(&pdev->dev, "P1V325_VDDARM_SW1AB");
-       if (test_regulator)
-               regulator_set_voltage(test_regulator, 1325000, 1325000);
-       test_regulator = regulator_get(&pdev->dev, "P1V325_VDDSOC_SW1C");
-       if (test_regulator)
-               regulator_set_voltage(test_regulator, 1325000, 1325000);
        test_regulator = regulator_get(&pdev->dev, "P3V0_VDDHIGH_SW2");
        if (test_regulator)
                regulator_set_voltage(test_regulator, 3000000, 3000000);