mmc: rk_sdmmc: substitude regulator_set_voltage for io switch usage
authorlintao <lintao@rock-chips.com>
Thu, 26 Mar 2015 09:14:55 +0000 (17:14 +0800)
committerlintao <lintao@rock-chips.com>
Thu, 26 Mar 2015 09:16:26 +0000 (17:16 +0800)
Signed-off-by: lintao <lintao@rock-chips.com>
drivers/mmc/host/rk_sdmmc.c

index 3a81403f37474a1b775960d5fee1e653fc2a5126..c37ef70ef97178bb496994cdc3fcb831fd66c1cd 100755 (executable)
@@ -1862,9 +1862,14 @@ static int dw_mci_do_start_signal_voltage_switch(struct dw_mci *host,
         case MMC_SIGNAL_VOLTAGE_330:
                /* Set 1.8V Signal Enable in the Host Control2 register to 0 */
                if (host->vmmc) {
-                       ret = io_domain_regulator_set_voltage(host->vmmc, 3300000, 3300000);
-                       /* regulator_put(host->vmmc); //to be done in remove function. */
-                       
+                       if (cpu_is_rk3288())
+                               ret = io_domain_regulator_set_voltage(
+                                               host->vmmc, 3300000, 3300000);
+                       else
+                               ret = regulator_set_voltage(host->vmmc, 3300000, 3300000);
+
+                       /* regulator_put(host->vmmc); //to be done in remove function. */
+
                        MMC_DBG_SW_VOL_FUNC(host->mmc,"%s   =%dmV  set 3.3end, ret=%d  \n", 
                            __func__, regulator_get_voltage(host->vmmc), ret);
                        if (ret) {
@@ -1899,7 +1904,14 @@ static int dw_mci_do_start_signal_voltage_switch(struct dw_mci *host,
                return -EAGAIN;
         case MMC_SIGNAL_VOLTAGE_180:
                if (host->vmmc) {
-                       ret = io_domain_regulator_set_voltage(host->vmmc,1800000, 1800000);
+                       if (cpu_is_rk3288())
+                               ret = io_domain_regulator_set_voltage(
+                                                       host->vmmc,
+                                                       1800000, 1800000);
+                       else
+                               ret = regulator_set_voltage(
+                                                       host->vmmc,
+                                                       1800000, 1800000);
                         /* regulator_put(host->vmmc);//to be done in remove function. */
 
                        MMC_DBG_SW_VOL_FUNC(host->mmc,"%d..%s   =%dmV  set 1.8end, ret=%d . \n",
@@ -1934,7 +1946,13 @@ static int dw_mci_do_start_signal_voltage_switch(struct dw_mci *host,
                return -EAGAIN;
         case MMC_SIGNAL_VOLTAGE_120:
                if (host->vmmc) {
-                       ret = io_domain_regulator_set_voltage(host->vmmc, 1200000, 1200000);
+                       if (cpu_is_rk3288())
+                               ret = io_domain_regulator_set_voltage(
+                                                       host->vmmc,
+                                                       1200000, 1200000);
+                       else
+                               ret = regulator_set_voltage(host->vmmc,
+                                                       1200000, 1200000);
                        if (ret) {
                                MMC_DBG_SW_VOL_FUNC(host->mmc, "%s: Switching to 1.2V signalling voltage "
                                                " failed\n", mmc_hostname(host->mmc));