Skip to contentSkip to conversation

mmc: sdhci: check 1.2v IO capability for SDHC host

PATCH Superseded Chuanxiao Dong 2 participants 3 messages Aug 14, 2014 – Aug 19, 2014

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mmc: sdhci: check 1.2v IO capability for SDHC host

Right now enable 1.2v IO voltage for SDHC is by using vqmmc. Thus for the host which doesn't have vqmmc, or its vqmmc does not support 1.2v, directly use MMC_CAP2_HS200 may cause HS200 failure.

So needs to check if vqmmc is able to support 1.2v. If it does not support, disable 1.2v IO for HS200.

---
 drivers/mmc/host/sdhci.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci.c +5 -1
index c026ec8..6b701e1 100644
@@ -2999,8 +2999,12 @@ int sdhci_add_host(struct sdhci_host *host)
 		/* SD3.0: SDR104 is supported so (for eMMC) the caps2
 		 * field can be promoted to support HS200.
 		 */
-		if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200))
+		if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200)) {
 			mmc->caps2 |= MMC_CAP2_HS200;
+			if (!host->vqmmc || !regulator_is_supported_voltage
+					(host->vqmmc, 1100000, 1300000))
+				mmc->caps2 &= ~MMC_CAP2_HS200_1_2V_SDR;
+		}
 	} else if (caps[1] & SDHCI_SUPPORT_SDR50)
 		mmc->caps |= MMC_CAP_UHS_SDR50;
 
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 18 lines · Chuanxiao Dong

Right now enable 1.2v IO voltage for SDHC is by using vqmmc. Thus for the host which doesn't have vqmmc, or its vqmmc does not support 1.2v, directly use MMC_CAP2_HS200 may cause HS200 failure.

So needs to check if vqmmc is able to support 1.2v. If it does not support, disable 1.2v IO for HS200.

---
 drivers/mmc/host/sdhci.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci.c +0 -0
index c026ec8..6b701e1 100644

drivers/mmc/host/sdhci.c int sdhci_add_host(struct sdhci_host *host) · line 3004

Quoted 7 lines
drivers/mmc/host/sdhci.c +2 -1
@@ -2999,8 +2999,12 @@ int sdhci_add_host(struct sdhci_host *host)
                /* SD3.0: SDR104 is supported so (for eMMC) the caps2
                 * field can be promoted to support HS200.
                 */
-               if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200))
+               if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200)) {
                        mmc->caps2 |= MMC_CAP2_HS200;
+                       if (!host->vqmmc || !regulator_is_supported_voltage

This needs a rebase and please use IS_ERR.

(!IS_ERR(mmc->supply.vqmmc) ...

Kind regards
Uffe

Quoted 13 lines
drivers/mmc/host/sdhci.c +3 -1
+                                       (host->vqmmc, 1100000, 1300000))
+                               mmc->caps2 &= ~MMC_CAP2_HS200_1_2V_SDR;
+               }
        } else if (caps[1] & SDHCI_SUPPORT_SDR50)
                mmc->caps |= MMC_CAP_UHS_SDR50;
 
--

1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
Quoted 39 lines

-----Original Message-----
From: Ulf Hansson [mailto:[email protected]]
Sent: Monday, August 18, 2014 5:39 PM
To: Dong, Chuanxiao
Cc: linux-mmc; [email protected]
Subject: Re: [PATCH] mmc: sdhci: check 1.2v IO capability for SDHC host

Quoted 17 lines · Chuanxiao Dong

Right now enable 1.2v IO voltage for SDHC is by using vqmmc. Thus for the host which doesn't have vqmmc, or its vqmmc does not support 1.2v, directly use MMC_CAP2_HS200 may cause HS200 failure.

So needs to check if vqmmc is able to support 1.2v. If it does not support, disable 1.2v IO for HS200.

---
 drivers/mmc/host/sdhci.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/mmc/host/sdhci.c index renamed from drivers/mmc/host/sdhci.c +0 -0

c026ec8..6b701e1 100644

drivers/mmc/host/sdhci.c int sdhci_add_host(struct sdhci_host *host) · line 3005

Quoted 8 lines
drivers/mmc/host/sdhci.c +3 -1
@@ -2999,8 +2999,12 @@ int sdhci_add_host(struct sdhci_host *host)
                /* SD3.0: SDR104 is supported so (for eMMC) the caps2
                 * field can be promoted to support HS200.
                 */
-               if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200))
+               if (!(host->quirks2 & SDHCI_QUIRK2_BROKEN_HS200)) {
                        mmc->caps2 |= MMC_CAP2_HS200;
+                       if (!host->vqmmc ||
+ !regulator_is_supported_voltage

This needs a rebase and please use IS_ERR.

Quoted 1 line

(!IS_ERR(mmc->supply.vqmmc) ...

Oh, I still use the old mmc-next tree. Will do the rebase;

Thanks
Chuanxiao

Quoted 20 lines

Kind regards
Uffe

drivers/mmc/host/sdhci.c int sdhci_add_host(struct sdhci_host *host) · line 3006

Quoted 1 line
drivers/mmc/host/sdhci.c +1 -0
+                                       (host->vqmmc, 1100000,

1300000))

drivers/mmc/host/sdhci.c int sdhci_add_host(struct sdhci_host *host) · line 3007

Quoted 1 line
drivers/mmc/host/sdhci.c +1 -0
+                               mmc->caps2 &=

~MMC_CAP2_HS200_1_2V_SDR;

Quoted 11 lines
drivers/mmc/host/sdhci.c +1 -1
+               }
        } else if (caps[1] & SDHCI_SUPPORT_SDR50)
                mmc->caps |= MMC_CAP_UHS_SDR50;
 
--

1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html