All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] mmc: sdhci: check 1.2v IO capability for SDHC host
@ 2014-08-19  3:02 Chuanxiao Dong
  2014-08-19  5:14 ` Jaehoon Chung
  2014-09-03  7:25 ` Ulf Hansson
  0 siblings, 2 replies; 4+ messages in thread
From: Chuanxiao Dong @ 2014-08-19  3:02 UTC (permalink / raw)
  To: ulf.hansson, chris; +Cc: linux-mmc

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>
---
Changelog V2: rebase this patch, and use IS_ERR to check vqmmc.

 drivers/mmc/host/sdhci.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 4cc2ff9..a23738c 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -3009,8 +3009,13 @@ 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 (IS_ERR(mmc->supply.vqmmc) ||
+					!regulator_is_supported_voltage
+					(mmc->supply.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] 4+ messages in thread

* Re: [PATCH V2] mmc: sdhci: check 1.2v IO capability for SDHC host
  2014-08-19  3:02 [PATCH V2] mmc: sdhci: check 1.2v IO capability for SDHC host Chuanxiao Dong
@ 2014-08-19  5:14 ` Jaehoon Chung
  2014-08-19  5:58   ` Dong, Chuanxiao
  2014-09-03  7:25 ` Ulf Hansson
  1 sibling, 1 reply; 4+ messages in thread
From: Jaehoon Chung @ 2014-08-19  5:14 UTC (permalink / raw)
  To: Chuanxiao Dong, ulf.hansson, chris; +Cc: linux-mmc

Hi, Dong.

Doesn't it need to consider for HS400 mode?

Best Regards,
Jaehoon Chung

On 08/19/2014 12:02 PM, Chuanxiao Dong 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>
> ---
> Changelog V2: rebase this patch, and use IS_ERR to check vqmmc.
> 
>  drivers/mmc/host/sdhci.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 4cc2ff9..a23738c 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -3009,8 +3009,13 @@ 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 (IS_ERR(mmc->supply.vqmmc) ||
> +					!regulator_is_supported_voltage
> +					(mmc->supply.vqmmc, 1100000, 1300000))
> +				mmc->caps2 &= ~MMC_CAP2_HS200_1_2V_SDR;
> +		}
>  	} else if (caps[1] & SDHCI_SUPPORT_SDR50)
>  		mmc->caps |= MMC_CAP_UHS_SDR50;
>  
> 


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

* RE: [PATCH V2] mmc: sdhci: check 1.2v IO capability for SDHC host
  2014-08-19  5:14 ` Jaehoon Chung
@ 2014-08-19  5:58   ` Dong, Chuanxiao
  0 siblings, 0 replies; 4+ messages in thread
From: Dong, Chuanxiao @ 2014-08-19  5:58 UTC (permalink / raw)
  To: Jaehoon Chung, ulf.hansson, chris; +Cc: linux-mmc



> -----Original Message-----
> From: Jaehoon Chung [mailto:jh80.chung@samsung.com]
> Sent: Tuesday, August 19, 2014 1:14 PM
> To: Dong, Chuanxiao; ulf.hansson@linaro.org; chris@printf.org
> Cc: linux-mmc@vger.kernel.org
> Subject: Re: [PATCH V2] mmc: sdhci: check 1.2v IO capability for SDHC host
> 
> Hi, Dong.
> 
> Doesn't it need to consider for HS400 mode?
HS400 should also consider this case, but not in this patch. Right now HS400 caps is still controlled by specific host controller driver, not the same way as HS200. Thus HS400 should be safe without this fix.

MMC_CAPS_HS200 will be set automatically when SDHCI host support SDR104 mode, no matter 1.2v I/O voltage is supported or not. So the purpose of this patch is to help resolve this.

Thanks
Chuanxiao

> 
> Best Regards,
> Jaehoon Chung
> 
> On 08/19/2014 12:02 PM, Chuanxiao Dong 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>
> > ---
> > Changelog V2: rebase this patch, and use IS_ERR to check vqmmc.
> >
> >  drivers/mmc/host/sdhci.c |    7 ++++++-
> >  1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index
> > 4cc2ff9..a23738c 100644
> > --- a/drivers/mmc/host/sdhci.c
> > +++ b/drivers/mmc/host/sdhci.c
> > @@ -3009,8 +3009,13 @@ 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 (IS_ERR(mmc->supply.vqmmc) ||
> > +					!regulator_is_supported_voltage
> > +					(mmc->supply.vqmmc, 1100000, 1300000))
> > +				mmc->caps2 &= ~MMC_CAP2_HS200_1_2V_SDR;
> > +		}
> >  	} else if (caps[1] & SDHCI_SUPPORT_SDR50)
> >  		mmc->caps |= MMC_CAP_UHS_SDR50;
> >
> >


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

* Re: [PATCH V2] mmc: sdhci: check 1.2v IO capability for SDHC host
  2014-08-19  3:02 [PATCH V2] mmc: sdhci: check 1.2v IO capability for SDHC host Chuanxiao Dong
  2014-08-19  5:14 ` Jaehoon Chung
@ 2014-09-03  7:25 ` Ulf Hansson
  1 sibling, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2014-09-03  7:25 UTC (permalink / raw)
  To: Chuanxiao Dong; +Cc: chris, linux-mmc

On 19 August 2014 05:02, 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>

Thanks! Applied for next!

Kind regards
Uffe

> ---
> Changelog V2: rebase this patch, and use IS_ERR to check vqmmc.
>
>  drivers/mmc/host/sdhci.c |    7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index 4cc2ff9..a23738c 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -3009,8 +3009,13 @@ 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 (IS_ERR(mmc->supply.vqmmc) ||
> +                                       !regulator_is_supported_voltage
> +                                       (mmc->supply.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	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-09-03  7:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-19  3:02 [PATCH V2] mmc: sdhci: check 1.2v IO capability for SDHC host Chuanxiao Dong
2014-08-19  5:14 ` Jaehoon Chung
2014-08-19  5:58   ` Dong, Chuanxiao
2014-09-03  7:25 ` Ulf Hansson

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.