From: Kyle Roeschley <kyle.roeschley@xxxxxx> On some SD host controllers, 1.8V signaling is required for reliable operation of the part. Add a capability which says that we must switch to 1.8V signaling during card initialization. Signed-off-by: Kyle Roeschley <kyle.roeschley@xxxxxx> Signed-off-by: Jennifer Dahm <jennifer.dahm@xxxxxx> --- drivers/mmc/core/sd.c | 7 +++++++ include/linux/mmc/host.h | 1 + 2 files changed, 8 insertions(+) diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index baf3d5d..b259671 100644 --- a/drivers/mmc/core/sd.c +++ b/drivers/mmc/core/sd.c @@ -782,6 +782,13 @@ int mmc_sd_get_cid(struct mmc_host *host, u32 ocr, u32 *cid, u32 *rocr) } } + if (host->caps2 & MMC_CAP2_REQUIRE_1_8V && + host->ios.signal_voltage != MMC_SIGNAL_VOLTAGE_180) { + pr_err("%s: Host requires UHS-capable card\n", + mmc_hostname(host)); + return -EINVAL; + } + err = mmc_send_cid(host, cid); return err; } diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 8514623..4d58c10 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -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_CQE (1 << 23) /* Has eMMC command queue engine */ #define MMC_CAP2_CQE_DCMD (1 << 24) /* CQE can issue a direct command */ +#define MMC_CAP2_REQUIRE_1_8V (1 << 25) /* Host requires 1.8V signalling */ int fixed_drv_type; /* fixed driver type for non-removable media */ -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html