diff mbox series

mmc: sdhci: Enable high speed conditional on the correspnding bit

Message ID 20200723041219.2438-1-faiz_abbas@ti.com
State Accepted
Delegated to: Peng Fan
Headers show
Series mmc: sdhci: Enable high speed conditional on the correspnding bit | expand

Commit Message

Faiz Abbas July 23, 2020, 4:12 a.m. UTC
The capabilities register has a field to indicate whether the host
supports high speed mode or not. Add high speed host_caps based on
this bit instead of enabling it by default.

Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
---
 drivers/mmc/sdhci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Michal Simek July 29, 2020, 3:07 p.m. UTC | #1
Hi,

čt 23. 7. 2020 v 6:12 odesílatel Faiz Abbas <faiz_abbas@ti.com> napsal:
>
> The capabilities register has a field to indicate whether the host
> supports high speed mode or not. Add high speed host_caps based on
> this bit instead of enabling it by default.
>
> Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
> ---
>  drivers/mmc/sdhci.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> index 16989dcf05..48d639fe93 100644
> --- a/drivers/mmc/sdhci.c
> +++ b/drivers/mmc/sdhci.c
> @@ -866,7 +866,10 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
>         if (host->quirks & SDHCI_QUIRK_BROKEN_VOLTAGE)
>                 cfg->voltages |= host->voltages;
>
> -       cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_4BIT;
> +       if (caps & SDHCI_CAN_DO_HISPD)
> +               cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz;
> +
> +       cfg->host_caps |= MMC_MODE_4BIT;
>
>         /* Since Host Controller Version3.0 */
>         if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {
> --
> 2.17.1
>

Reviewed-by: Michal Simek <michal.simek@xilnx.com>
Tested-by: Michal Simek <michal.simek@xilnx.com> (zcu104 with
sdhci-caps-mask = <0 0x200000>;)

Thanks,
Michal
Michal Simek Aug. 13, 2020, 10:48 a.m. UTC | #2
Hi Peng,

st 29. 7. 2020 v 17:07 odesílatel Michal Simek <monstr@monstr.eu> napsal:
>
> Hi,
>
> čt 23. 7. 2020 v 6:12 odesílatel Faiz Abbas <faiz_abbas@ti.com> napsal:
> >
> > The capabilities register has a field to indicate whether the host
> > supports high speed mode or not. Add high speed host_caps based on
> > this bit instead of enabling it by default.
> >
> > Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
> > ---
> >  drivers/mmc/sdhci.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> > index 16989dcf05..48d639fe93 100644
> > --- a/drivers/mmc/sdhci.c
> > +++ b/drivers/mmc/sdhci.c
> > @@ -866,7 +866,10 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
> >         if (host->quirks & SDHCI_QUIRK_BROKEN_VOLTAGE)
> >                 cfg->voltages |= host->voltages;
> >
> > -       cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_4BIT;
> > +       if (caps & SDHCI_CAN_DO_HISPD)
> > +               cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz;
> > +
> > +       cfg->host_caps |= MMC_MODE_4BIT;
> >
> >         /* Since Host Controller Version3.0 */
> >         if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {
> > --
> > 2.17.1
> >
>
> Reviewed-by: Michal Simek <michal.simek@xilnx.com>
> Tested-by: Michal Simek <michal.simek@xilnx.com> (zcu104 with
> sdhci-caps-mask = <0 0x200000>;)

Peng: Can you please take this patch to your tree? Or I will take it.

Thanks,
Michal
Michal Simek Aug. 20, 2020, 8:03 a.m. UTC | #3
Hi,

čt 13. 8. 2020 v 12:48 odesílatel Michal Simek <monstr@monstr.eu> napsal:
>
> Hi Peng,
>
> st 29. 7. 2020 v 17:07 odesílatel Michal Simek <monstr@monstr.eu> napsal:
> >
> > Hi,
> >
> > čt 23. 7. 2020 v 6:12 odesílatel Faiz Abbas <faiz_abbas@ti.com> napsal:
> > >
> > > The capabilities register has a field to indicate whether the host
> > > supports high speed mode or not. Add high speed host_caps based on
> > > this bit instead of enabling it by default.
> > >
> > > Signed-off-by: Faiz Abbas <faiz_abbas@ti.com>
> > > ---
> > >  drivers/mmc/sdhci.c | 5 ++++-
> > >  1 file changed, 4 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> > > index 16989dcf05..48d639fe93 100644
> > > --- a/drivers/mmc/sdhci.c
> > > +++ b/drivers/mmc/sdhci.c
> > > @@ -866,7 +866,10 @@ int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
> > >         if (host->quirks & SDHCI_QUIRK_BROKEN_VOLTAGE)
> > >                 cfg->voltages |= host->voltages;
> > >
> > > -       cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_4BIT;
> > > +       if (caps & SDHCI_CAN_DO_HISPD)
> > > +               cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz;
> > > +
> > > +       cfg->host_caps |= MMC_MODE_4BIT;
> > >
> > >         /* Since Host Controller Version3.0 */
> > >         if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {
> > > --
> > > 2.17.1
> > >
> >
> > Reviewed-by: Michal Simek <michal.simek@xilnx.com>
> > Tested-by: Michal Simek <michal.simek@xilnx.com> (zcu104 with
> > sdhci-caps-mask = <0 0x200000>;)
>
> Peng: Can you please take this patch to your tree? Or I will take it.

I applied this patch but I have fixed typo in subject.

M
diff mbox series

Patch

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 16989dcf05..48d639fe93 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -866,7 +866,10 @@  int sdhci_setup_cfg(struct mmc_config *cfg, struct sdhci_host *host,
 	if (host->quirks & SDHCI_QUIRK_BROKEN_VOLTAGE)
 		cfg->voltages |= host->voltages;
 
-	cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz | MMC_MODE_4BIT;
+	if (caps & SDHCI_CAN_DO_HISPD)
+		cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz;
+
+	cfg->host_caps |= MMC_MODE_4BIT;
 
 	/* Since Host Controller Version3.0 */
 	if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) {