From 9e36f69ea168e9bc276c0e1e0f52b07b7debc3cc Mon Sep 17 00:00:00 2001 From: Venkat Gopalakrishnan Date: Thu, 28 Aug 2014 18:15:45 -0700 Subject: [PATCH] mmc: sdhci-msm: Add dual voltage capability SDCC5 controller doesn't advertise 1.8v capability by default. Dual voltage capability is required for SD3.0 support. Add this capability for controllers that support this based on device tree configuration. Change-Id: Ie4cd6db2e7230bc22cd393c8e37d99f49c777cd0 Signed-off-by: Venkat Gopalakrishnan --- drivers/mmc/host/sdhci-msm.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index ddce818e105c..b2edcaa1c09a 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -2746,11 +2746,20 @@ static void sdhci_set_default_hw_caps(struct sdhci_msm_host *msm_host, /* * Starting with SDCC 5 controller (core major version = 1) - * controller won't advertise 3.0v and 8-bit features except for - * some targets. + * controller won't advertise 3.0v, 1.8v and 8-bit features + * except for some targets. */ if (major >= 1 && minor != 0x11 && minor != 0x12) { + struct sdhci_msm_reg_data *vdd_io_reg; caps = CORE_3_0V_SUPPORT; + /* + * Enable 1.8V support capability on controllers that + * support dual voltage + */ + vdd_io_reg = msm_host->pdata->vreg_data->vdd_io_data; + if (vdd_io_reg && + (vdd_io_reg->low_vol_level != vdd_io_reg->high_vol_level)) + caps |= CORE_1_8V_SUPPORT; if (msm_host->pdata->mmc_bus_width == MMC_CAP_8_BIT_DATA) caps |= CORE_8_BIT_SUPPORT; writel_relaxed(