diff mbox series

[RFC,v3.1,14/27] mmc: sdhci-uhs2: skip signal_voltage_switch()

Message ID 20201106022726.19831-15-takahiro.akashi@linaro.org
State New
Headers show
Series Add support UHS-II for GL9755 | expand

Commit Message

AKASHI Takahiro Nov. 6, 2020, 2:27 a.m. UTC
For UHS2, the signal voltage is supplied by vdd2 which is already 1.8v,
so no voltage switch required.

Signed-off-by: Ben Chuang <ben.chuang@genesyslogic.com.tw>

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

---
 drivers/mmc/host/sdhci-uhs2.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)

-- 
2.28.0

Comments

Adrian Hunter Nov. 26, 2020, 8:16 a.m. UTC | #1
On 6/11/20 4:27 am, AKASHI Takahiro wrote:
> For UHS2, the signal voltage is supplied by vdd2 which is already 1.8v,

> so no voltage switch required.

> 

> Signed-off-by: Ben Chuang <ben.chuang@genesyslogic.com.tw>

> Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

> ---

>  drivers/mmc/host/sdhci-uhs2.c | 26 ++++++++++++++++++++++++++

>  1 file changed, 26 insertions(+)

> 

> diff --git a/drivers/mmc/host/sdhci-uhs2.c b/drivers/mmc/host/sdhci-uhs2.c

> index 2bf78cc4e9ed..1eca89359351 100644

> --- a/drivers/mmc/host/sdhci-uhs2.c

> +++ b/drivers/mmc/host/sdhci-uhs2.c

> @@ -178,6 +178,29 @@ void sdhci_uhs2_set_power(struct sdhci_host *host, unsigned char mode,

>  }

>  EXPORT_SYMBOL_GPL(sdhci_uhs2_set_power);

>  

> +/*****************************************************************************\

> + *                                                                           *

> + * MMC callbacks                                                             *

> + *                                                                           *

> +\*****************************************************************************/

> +

> +static int sdhci_uhs2_start_signal_voltage_switch(struct mmc_host *mmc,

> +						  struct mmc_ios *ios)

> +{

> +	struct sdhci_host *host = mmc_priv(mmc);

> +

> +	/*

> +	 * For UHS2, the signal voltage is supplied by vdd2 which is

> +	 * already 1.8v so no voltage switch required.

> +	 */

> +        if (IS_ENABLED(CONFIG_MMC_SDHCI_UHS2) &&

> +             host->version >= SDHCI_SPEC_400 &&

> +             host->mmc->flags & MMC_UHS2_SUPPORT)


Could this be the same helper function suggested elsewhere i.e.

	if (!sdhci_uhs2_mode(host))

> +                return 0;

> +

> +	return sdhci_start_signal_voltage_switch(mmc, ios);

> +}

> +

>  /*****************************************************************************\

>   *                                                                           *

>   * Driver init/exit                                                          *

> @@ -186,6 +209,9 @@ EXPORT_SYMBOL_GPL(sdhci_uhs2_set_power);

>  

>  static int sdhci_uhs2_host_ops_init(struct sdhci_host *host)

>  {

> +	host->mmc_host_ops.start_signal_voltage_switch =

> +		sdhci_uhs2_start_signal_voltage_switch;

> +

>  	return 0;

>  }

>  

>
AKASHI Takahiro Nov. 30, 2020, 7:38 a.m. UTC | #2
On Thu, Nov 26, 2020 at 10:16:44AM +0200, Adrian Hunter wrote:
> On 6/11/20 4:27 am, AKASHI Takahiro wrote:

> > For UHS2, the signal voltage is supplied by vdd2 which is already 1.8v,

> > so no voltage switch required.

> > 

> > Signed-off-by: Ben Chuang <ben.chuang@genesyslogic.com.tw>

> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>

> > ---

> >  drivers/mmc/host/sdhci-uhs2.c | 26 ++++++++++++++++++++++++++

> >  1 file changed, 26 insertions(+)

> > 

> > diff --git a/drivers/mmc/host/sdhci-uhs2.c b/drivers/mmc/host/sdhci-uhs2.c

> > index 2bf78cc4e9ed..1eca89359351 100644

> > --- a/drivers/mmc/host/sdhci-uhs2.c

> > +++ b/drivers/mmc/host/sdhci-uhs2.c

> > @@ -178,6 +178,29 @@ void sdhci_uhs2_set_power(struct sdhci_host *host, unsigned char mode,

> >  }

> >  EXPORT_SYMBOL_GPL(sdhci_uhs2_set_power);

> >  

> > +/*****************************************************************************\

> > + *                                                                           *

> > + * MMC callbacks                                                             *

> > + *                                                                           *

> > +\*****************************************************************************/

> > +

> > +static int sdhci_uhs2_start_signal_voltage_switch(struct mmc_host *mmc,

> > +						  struct mmc_ios *ios)

> > +{

> > +	struct sdhci_host *host = mmc_priv(mmc);

> > +

> > +	/*

> > +	 * For UHS2, the signal voltage is supplied by vdd2 which is

> > +	 * already 1.8v so no voltage switch required.

> > +	 */

> > +        if (IS_ENABLED(CONFIG_MMC_SDHCI_UHS2) &&

> > +             host->version >= SDHCI_SPEC_400 &&

> > +             host->mmc->flags & MMC_UHS2_SUPPORT)

> 

> Could this be the same helper function suggested elsewhere i.e.

> 

> 	if (!sdhci_uhs2_mode(host))



ditto. I'd defer the change until some time later.

-Takahiro Akashi

> 

> > +                return 0;

> > +

> > +	return sdhci_start_signal_voltage_switch(mmc, ios);

> > +}

> > +

> >  /*****************************************************************************\

> >   *                                                                           *

> >   * Driver init/exit                                                          *

> > @@ -186,6 +209,9 @@ EXPORT_SYMBOL_GPL(sdhci_uhs2_set_power);

> >  

> >  static int sdhci_uhs2_host_ops_init(struct sdhci_host *host)

> >  {

> > +	host->mmc_host_ops.start_signal_voltage_switch =

> > +		sdhci_uhs2_start_signal_voltage_switch;

> > +

> >  	return 0;

> >  }

> >  

> > 

>
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-uhs2.c b/drivers/mmc/host/sdhci-uhs2.c
index 2bf78cc4e9ed..1eca89359351 100644
--- a/drivers/mmc/host/sdhci-uhs2.c
+++ b/drivers/mmc/host/sdhci-uhs2.c
@@ -178,6 +178,29 @@  void sdhci_uhs2_set_power(struct sdhci_host *host, unsigned char mode,
 }
 EXPORT_SYMBOL_GPL(sdhci_uhs2_set_power);
 
+/*****************************************************************************\
+ *                                                                           *
+ * MMC callbacks                                                             *
+ *                                                                           *
+\*****************************************************************************/
+
+static int sdhci_uhs2_start_signal_voltage_switch(struct mmc_host *mmc,
+						  struct mmc_ios *ios)
+{
+	struct sdhci_host *host = mmc_priv(mmc);
+
+	/*
+	 * For UHS2, the signal voltage is supplied by vdd2 which is
+	 * already 1.8v so no voltage switch required.
+	 */
+        if (IS_ENABLED(CONFIG_MMC_SDHCI_UHS2) &&
+             host->version >= SDHCI_SPEC_400 &&
+             host->mmc->flags & MMC_UHS2_SUPPORT)
+                return 0;
+
+	return sdhci_start_signal_voltage_switch(mmc, ios);
+}
+
 /*****************************************************************************\
  *                                                                           *
  * Driver init/exit                                                          *
@@ -186,6 +209,9 @@  EXPORT_SYMBOL_GPL(sdhci_uhs2_set_power);
 
 static int sdhci_uhs2_host_ops_init(struct sdhci_host *host)
 {
+	host->mmc_host_ops.start_signal_voltage_switch =
+		sdhci_uhs2_start_signal_voltage_switch;
+
 	return 0;
 }