diff options
| -rw-r--r-- | drivers/mmc/host/mtk-sd.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c index 07809f4007be..b17f30da97da 100644 --- a/drivers/mmc/host/mtk-sd.c +++ b/drivers/mmc/host/mtk-sd.c | |||
| @@ -1021,26 +1021,19 @@ static void msdc_set_buswidth(struct msdc_host *host, u32 width) | |||
| 1021 | static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios) | 1021 | static int msdc_ops_switch_volt(struct mmc_host *mmc, struct mmc_ios *ios) |
| 1022 | { | 1022 | { |
| 1023 | struct msdc_host *host = mmc_priv(mmc); | 1023 | struct msdc_host *host = mmc_priv(mmc); |
| 1024 | int min_uv, max_uv; | ||
| 1025 | int ret = 0; | 1024 | int ret = 0; |
| 1026 | 1025 | ||
| 1027 | if (!IS_ERR(mmc->supply.vqmmc)) { | 1026 | if (!IS_ERR(mmc->supply.vqmmc)) { |
| 1028 | if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_330) { | 1027 | if (ios->signal_voltage != MMC_SIGNAL_VOLTAGE_330 && |
| 1029 | min_uv = 3300000; | 1028 | ios->signal_voltage != MMC_SIGNAL_VOLTAGE_180) { |
| 1030 | max_uv = 3300000; | ||
| 1031 | } else if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180) { | ||
| 1032 | min_uv = 1800000; | ||
| 1033 | max_uv = 1800000; | ||
| 1034 | } else { | ||
| 1035 | dev_err(host->dev, "Unsupported signal voltage!\n"); | 1029 | dev_err(host->dev, "Unsupported signal voltage!\n"); |
| 1036 | return -EINVAL; | 1030 | return -EINVAL; |
| 1037 | } | 1031 | } |
| 1038 | 1032 | ||
| 1039 | ret = regulator_set_voltage(mmc->supply.vqmmc, min_uv, max_uv); | 1033 | ret = mmc_regulator_set_vqmmc(mmc, ios); |
| 1040 | if (ret) { | 1034 | if (ret) { |
| 1041 | dev_dbg(host->dev, | 1035 | dev_dbg(host->dev, "Regulator set error %d (%d)\n", |
| 1042 | "Regulator set error %d: %d - %d\n", | 1036 | ret, ios->signal_voltage); |
| 1043 | ret, min_uv, max_uv); | ||
| 1044 | } else { | 1037 | } else { |
| 1045 | /* Apply different pinctrl settings for different signal voltage */ | 1038 | /* Apply different pinctrl settings for different signal voltage */ |
| 1046 | if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180) | 1039 | if (ios->signal_voltage == MMC_SIGNAL_VOLTAGE_180) |
