aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorUlf Hansson <ulf.hansson@linaro.org>2013-05-15 15:47:33 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-05-22 19:07:38 -0400
commit0f3ed7f75cf1a16df9309f3a9ffaf62a3fc1f0bb (patch)
treea5ec34059073724242c92f0a9b40ab8ca166c649 /drivers/mmc
parent7c0136ef773c206e242b9718740377a45747bd70 (diff)
ARM: 7724/1: mmc: mmci: Support signal voltage switch for UHS cards
Add .start_signal_voltage_switch callback to be able to support UHS cards. The voltage switch requires the optional vqmmc regulator to exist since the actual voltage switch will be performed directly on it. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/mmci.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index a8bbdd1c4314..cb9e562b3571 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -1266,6 +1266,39 @@ static int mmci_get_cd(struct mmc_host *mmc)
1266 return status; 1266 return status;
1267} 1267}
1268 1268
1269static int mmci_sig_volt_switch(struct mmc_host *mmc, struct mmc_ios *ios)
1270{
1271 int ret = 0;
1272
1273 if (!IS_ERR(mmc->supply.vqmmc)) {
1274
1275 pm_runtime_get_sync(mmc_dev(mmc));
1276
1277 switch (ios->signal_voltage) {
1278 case MMC_SIGNAL_VOLTAGE_330:
1279 ret = regulator_set_voltage(mmc->supply.vqmmc,
1280 2700000, 3600000);
1281 break;
1282 case MMC_SIGNAL_VOLTAGE_180:
1283 ret = regulator_set_voltage(mmc->supply.vqmmc,
1284 1700000, 1950000);
1285 break;
1286 case MMC_SIGNAL_VOLTAGE_120:
1287 ret = regulator_set_voltage(mmc->supply.vqmmc,
1288 1100000, 1300000);
1289 break;
1290 }
1291
1292 if (ret)
1293 dev_warn(mmc_dev(mmc), "Voltage switch failed\n");
1294
1295 pm_runtime_mark_last_busy(mmc_dev(mmc));
1296 pm_runtime_put_autosuspend(mmc_dev(mmc));
1297 }
1298
1299 return ret;
1300}
1301
1269static irqreturn_t mmci_cd_irq(int irq, void *dev_id) 1302static irqreturn_t mmci_cd_irq(int irq, void *dev_id)
1270{ 1303{
1271 struct mmci_host *host = dev_id; 1304 struct mmci_host *host = dev_id;
@@ -1282,6 +1315,7 @@ static const struct mmc_host_ops mmci_ops = {
1282 .set_ios = mmci_set_ios, 1315 .set_ios = mmci_set_ios,
1283 .get_ro = mmci_get_ro, 1316 .get_ro = mmci_get_ro,
1284 .get_cd = mmci_get_cd, 1317 .get_cd = mmci_get_cd,
1318 .start_signal_voltage_switch = mmci_sig_volt_switch,
1285}; 1319};
1286 1320
1287#ifdef CONFIG_OF 1321#ifdef CONFIG_OF