All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: sdhci: check 1.2v IO capability for SDHC host
@ 2014-08-14 10:05 Chuanxiao Dong
  2014-08-18  9:38 ` Ulf Hansson
  0 siblings, 1 reply; 3+ messages in thread
From: Chuanxiao Dong @ 2014-08-14 10:05 UTC (permalink / raw)
  To: linux-mmc, ulf.hansson, chris

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.

Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
---
 drivers/mmc/host/sdhci.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index c026ec8..6b701e1 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -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;
 
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mmc: sdhci: check 1.2v IO capability for SDHC host
  2014-08-14 10:05 [PATCH] mmc: sdhci: check 1.2v IO capability for SDHC host Chuanxiao Dong
@ 2014-08-18  9:38 ` Ulf Hansson
  2014-08-19  2:06   ` Dong, Chuanxiao
  0 siblings, 1 reply; 3+ messages in thread
From: Ulf Hansson @ 2014-08-18  9:38 UTC (permalink / raw)
  To: Chuanxiao Dong; +Cc: linux-mmc, chris

On 14 August 2014 12:05, Chuanxiao Dong <chuanxiao.dong@intel.com> wrote:
> 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.
>
> Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
> ---
>  drivers/mmc/host/sdhci.c |    6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index c026ec8..6b701e1 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -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


> +                                       (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 majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] mmc: sdhci: check 1.2v IO capability for SDHC host
  2014-08-18  9:38 ` Ulf Hansson
@ 2014-08-19  2:06   ` Dong, Chuanxiao
  0 siblings, 0 replies; 3+ messages in thread
From: Dong, Chuanxiao @ 2014-08-19  2:06 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc, chris@printf.org



> -----Original Message-----
> From: Ulf Hansson [mailto:ulf.hansson@linaro.org]
> Sent: Monday, August 18, 2014 5:39 PM
> To: Dong, Chuanxiao
> Cc: linux-mmc; chris@printf.org
> Subject: Re: [PATCH] mmc: sdhci: check 1.2v IO capability for SDHC host
> 
> On 14 August 2014 12:05, Chuanxiao Dong <chuanxiao.dong@intel.com>
> wrote:
> > 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.
> >
> > Signed-off-by: Chuanxiao Dong <chuanxiao.dong@intel.com>
> > ---
> >  drivers/mmc/host/sdhci.c |    6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index
> > c026ec8..6b701e1 100644
> > --- a/drivers/mmc/host/sdhci.c
> > +++ b/drivers/mmc/host/sdhci.c
> > @@ -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) ...
Oh, I still use the old mmc-next tree. Will do the rebase;

Thanks
Chuanxiao

> 
> Kind regards
> Uffe
> 
> 
> > +                                       (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 majordomo@vger.kernel.org More majordomo
> > info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-19  2:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-14 10:05 [PATCH] mmc: sdhci: check 1.2v IO capability for SDHC host Chuanxiao Dong
2014-08-18  9:38 ` Ulf Hansson
2014-08-19  2:06   ` Dong, Chuanxiao

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.