Commit 247cfe53 authored by Kyle Roeschley's avatar Kyle Roeschley Committed by Ulf Hansson

mmc: core: Add capability to avoid 3.3V signaling

Some SD host controllers cannot handle extended use of 3.3V signaling.
To accommodate these controllers, add a capability that requires us to
negotiate the voltage down from 3.3V during card initialization.
Signed-off-by: default avatarKyle Roeschley <kyle.roeschley@ni.com>
Signed-off-by: default avatarJennifer Dahm <jennifer.dahm@ni.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 1d6efe08
...@@ -1830,6 +1830,14 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr, ...@@ -1830,6 +1830,14 @@ static int mmc_init_card(struct mmc_host *host, u32 ocr,
} }
} }
if (host->caps2 & MMC_CAP2_AVOID_3_3V &&
host->ios.signal_voltage == MMC_SIGNAL_VOLTAGE_330) {
pr_err("%s: Host failed to negotiate down from 3.3V\n",
mmc_hostname(host));
err = -EINVAL;
goto free_card;
}
if (!oldcard) if (!oldcard)
host->card = card; host->card = card;
......
...@@ -1058,6 +1058,14 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr, ...@@ -1058,6 +1058,14 @@ static int mmc_sd_init_card(struct mmc_host *host, u32 ocr,
mmc_set_bus_width(host, MMC_BUS_WIDTH_4); mmc_set_bus_width(host, MMC_BUS_WIDTH_4);
} }
} }
if (host->caps2 & MMC_CAP2_AVOID_3_3V &&
host->ios.signal_voltage == MMC_SIGNAL_VOLTAGE_330) {
pr_err("%s: Host failed to negotiate down from 3.3V\n",
mmc_hostname(host));
err = -EINVAL;
goto free_card;
}
done: done:
host->card = card; host->card = card;
return 0; return 0;
......
...@@ -792,6 +792,14 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr, ...@@ -792,6 +792,14 @@ static int mmc_sdio_init_card(struct mmc_host *host, u32 ocr,
if (err) if (err)
goto remove; goto remove;
} }
if (host->caps2 & MMC_CAP2_AVOID_3_3V &&
host->ios.signal_voltage == MMC_SIGNAL_VOLTAGE_330) {
pr_err("%s: Host failed to negotiate down from 3.3V\n",
mmc_hostname(host));
err = -EINVAL;
goto remove;
}
finish: finish:
if (!oldcard) if (!oldcard)
host->card = card; host->card = card;
......
...@@ -354,6 +354,7 @@ struct mmc_host { ...@@ -354,6 +354,7 @@ struct mmc_host {
#define MMC_CAP2_NO_MMC (1 << 22) /* Do not send (e)MMC commands during initialization */ #define MMC_CAP2_NO_MMC (1 << 22) /* Do not send (e)MMC commands during initialization */
#define MMC_CAP2_CQE (1 << 23) /* Has eMMC command queue engine */ #define MMC_CAP2_CQE (1 << 23) /* Has eMMC command queue engine */
#define MMC_CAP2_CQE_DCMD (1 << 24) /* CQE can issue a direct command */ #define MMC_CAP2_CQE_DCMD (1 << 24) /* CQE can issue a direct command */
#define MMC_CAP2_AVOID_3_3V (1 << 25) /* Host must negotiate down from 3.3V */
int fixed_drv_type; /* fixed driver type for non-removable media */ int fixed_drv_type; /* fixed driver type for non-removable media */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment