linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mmc: mmc_spi: parse speed mode options
@ 2022-03-31  7:28 Christian Löhle
  2022-03-31  7:29 ` [PATCH 2/2] mmc: mmc_spi: enable Highspeed for above 25MHz Christian Löhle
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Christian Löhle @ 2022-03-31  7:28 UTC (permalink / raw)
  To: Ulf Hansson, linux-kernel, linux-mmc, andriy.shevchenko,
	Christian Löhle
  Cc: adrian.hunter, digetx, avri.altman

Since SD and MMC Highspeed modes are also valid for SPI let's parse
them too.

Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
---
 drivers/mmc/host/of_mmc_spi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c
index 3629550528b6..bf54776fb26c 100644
--- a/drivers/mmc/host/of_mmc_spi.c
+++ b/drivers/mmc/host/of_mmc_spi.c
@@ -70,6 +70,10 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
 	} else {
 		oms->pdata.caps |= MMC_CAP_NEEDS_POLL;
 	}
+	if (device_property_read_bool(dev, "cap-sd-highspeed"))
+		oms->pdata.caps |= MMC_CAP_SD_HIGHSPEED;
+	if (device_property_read_bool(dev, "cap-mmc-highspeed"))
+		oms->pdata.caps |= MMC_CAP_MMC_HIGHSPEED;
 
 	dev->platform_data = &oms->pdata;
 	return dev->platform_data;
-- 
2.34.1
Hyperstone GmbH | Reichenaustr. 39a  | 78467 Konstanz
Managing Director: Dr. Jan Peter Berns.
Commercial register of local courts: Freiburg HRB381782


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

* [PATCH 2/2] mmc: mmc_spi: enable Highspeed for above 25MHz
  2022-03-31  7:28 [PATCH 1/2] mmc: mmc_spi: parse speed mode options Christian Löhle
@ 2022-03-31  7:29 ` Christian Löhle
  2022-03-31 14:07   ` andriy.shevchenko
  2022-03-31 14:06 ` [PATCH 1/2] mmc: mmc_spi: parse speed mode options Andy Shevchenko
  2022-04-06 14:55 ` Ulf Hansson
  2 siblings, 1 reply; 7+ messages in thread
From: Christian Löhle @ 2022-03-31  7:29 UTC (permalink / raw)
  To: Ulf Hansson, linux-kernel, linux-mmc, andriy.shevchenko,
	Christian Löhle
  Cc: adrian.hunter, digetx, avri.altman

Any setup supporting more than 25MHz is able to utilize
highspeed, so enable it even when not explicitly specified.

Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
---
 drivers/mmc/host/mmc_spi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
index 106dd204b1a7..0a74c2f55542 100644
--- a/drivers/mmc/host/mmc_spi.c
+++ b/drivers/mmc/host/mmc_spi.c
@@ -1378,6 +1378,9 @@ static int mmc_spi_probe(struct spi_device *spi)
 	mmc->f_min = 400000;
 	mmc->f_max = spi->max_speed_hz;
 
+	if (mmc->f_max > 25000000)
+		mmc->caps |= MMC_CAP_SD_HIGHSPEED | MMC_CAP_MMC_HIGHSPEED;
+
 	host = mmc_priv(mmc);
 	host->mmc = mmc;
 	host->spi = spi;
-- 
2.34.1
Hyperstone GmbH | Reichenaustr. 39a  | 78467 Konstanz
Managing Director: Dr. Jan Peter Berns.
Commercial register of local courts: Freiburg HRB381782


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

* Re: [PATCH 1/2] mmc: mmc_spi: parse speed mode options
  2022-03-31  7:28 [PATCH 1/2] mmc: mmc_spi: parse speed mode options Christian Löhle
  2022-03-31  7:29 ` [PATCH 2/2] mmc: mmc_spi: enable Highspeed for above 25MHz Christian Löhle
@ 2022-03-31 14:06 ` Andy Shevchenko
  2022-04-06 14:55 ` Ulf Hansson
  2 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2022-03-31 14:06 UTC (permalink / raw)
  To: Christian Löhle
  Cc: Ulf Hansson, linux-kernel, linux-mmc, adrian.hunter, digetx, avri.altman

On Thu, Mar 31, 2022 at 07:28:47AM +0000, Christian Löhle wrote:
> Since SD and MMC Highspeed modes are also valid for SPI let's parse
> them too.

Makes sense to me.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

> Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
> ---
>  drivers/mmc/host/of_mmc_spi.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c
> index 3629550528b6..bf54776fb26c 100644
> --- a/drivers/mmc/host/of_mmc_spi.c
> +++ b/drivers/mmc/host/of_mmc_spi.c
> @@ -70,6 +70,10 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
>  	} else {
>  		oms->pdata.caps |= MMC_CAP_NEEDS_POLL;
>  	}
> +	if (device_property_read_bool(dev, "cap-sd-highspeed"))
> +		oms->pdata.caps |= MMC_CAP_SD_HIGHSPEED;
> +	if (device_property_read_bool(dev, "cap-mmc-highspeed"))
> +		oms->pdata.caps |= MMC_CAP_MMC_HIGHSPEED;
> 
>  	dev->platform_data = &oms->pdata;
>  	return dev->platform_data;
> --
> 2.34.1
> Hyperstone GmbH | Reichenaustr. 39a  | 78467 Konstanz
> Managing Director: Dr. Jan Peter Berns.
> Commercial register of local courts: Freiburg HRB381782
> 

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH 2/2] mmc: mmc_spi: enable Highspeed for above 25MHz
  2022-03-31  7:29 ` [PATCH 2/2] mmc: mmc_spi: enable Highspeed for above 25MHz Christian Löhle
@ 2022-03-31 14:07   ` andriy.shevchenko
  2022-04-05  9:20     ` Christian Löhle
  0 siblings, 1 reply; 7+ messages in thread
From: andriy.shevchenko @ 2022-03-31 14:07 UTC (permalink / raw)
  To: Christian Löhle
  Cc: Ulf Hansson, linux-kernel, linux-mmc, adrian.hunter, digetx, avri.altman

On Thu, Mar 31, 2022 at 07:29:37AM +0000, Christian Löhle wrote:
> Any setup supporting more than 25MHz is able to utilize
> highspeed, so enable it even when not explicitly specified.

I'm not sure about this. I prefer to be on the safer side, i.e.
follow only what is supplied by firmware (ACPI / DT).

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH 2/2] mmc: mmc_spi: enable Highspeed for above 25MHz
  2022-03-31 14:07   ` andriy.shevchenko
@ 2022-04-05  9:20     ` Christian Löhle
  2022-04-05 12:56       ` Ulf Hansson
  0 siblings, 1 reply; 7+ messages in thread
From: Christian Löhle @ 2022-04-05  9:20 UTC (permalink / raw)
  To: andriy.shevchenko, Ulf Hansson
  Cc: Ulf Hansson, linux-kernel, linux-mmc, adrian.hunter

Understood and sure, then I'll take 2/2 back.
@Ulf, would you like a v2 just containing 1/2 or is it fine like this?




From: andriy.shevchenko@linux.intel.com <andriy.shevchenko@linux.intel.com>
Sent: Thursday, March 31, 2022 4:07 PM
To: Christian Löhle
Cc: Ulf Hansson; linux-kernel@vger.kernel.org; linux-mmc@vger.kernel.org; adrian.hunter@intel.com; digetx@gmail.com; avri.altman@wdc.com
Subject: Re: [PATCH 2/2] mmc: mmc_spi: enable Highspeed for above 25MHz
    
On Thu, Mar 31, 2022 at 07:29:37AM +0000, Christian Löhle wrote:
> Any setup supporting more than 25MHz is able to utilize
> highspeed, so enable it even when not explicitly specified.

I'm not sure about this. I prefer to be on the safer side, i.e.
follow only what is supplied by firmware (ACPI / DT).

-- 
With Best Regards,
Andy Shevchenko


    =
Hyperstone GmbH | Reichenaustr. 39a  | 78467 Konstanz
Managing Director: Dr. Jan Peter Berns.
Commercial register of local courts: Freiburg HRB381782


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

* Re: [PATCH 2/2] mmc: mmc_spi: enable Highspeed for above 25MHz
  2022-04-05  9:20     ` Christian Löhle
@ 2022-04-05 12:56       ` Ulf Hansson
  0 siblings, 0 replies; 7+ messages in thread
From: Ulf Hansson @ 2022-04-05 12:56 UTC (permalink / raw)
  To: Christian Löhle
  Cc: andriy.shevchenko, linux-kernel, linux-mmc, adrian.hunter

On Tue, 5 Apr 2022 at 11:20, Christian Löhle <CLoehle@hyperstone.com> wrote:
>
> Understood and sure, then I'll take 2/2 back.
> @Ulf, would you like a v2 just containing 1/2 or is it fine like this?

It's fine as is, I will pick up patch1 very soon.

Kind regards
Uffe

>
>
>
>
> From: andriy.shevchenko@linux.intel.com <andriy.shevchenko@linux.intel.com>
> Sent: Thursday, March 31, 2022 4:07 PM
> To: Christian Löhle
> Cc: Ulf Hansson; linux-kernel@vger.kernel.org; linux-mmc@vger.kernel.org; adrian.hunter@intel.com; digetx@gmail.com; avri.altman@wdc.com
> Subject: Re: [PATCH 2/2] mmc: mmc_spi: enable Highspeed for above 25MHz
>
> On Thu, Mar 31, 2022 at 07:29:37AM +0000, Christian Löhle wrote:
> > Any setup supporting more than 25MHz is able to utilize
> > highspeed, so enable it even when not explicitly specified.
>
> I'm not sure about this. I prefer to be on the safer side, i.e.
> follow only what is supplied by firmware (ACPI / DT).
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
>     =
> Hyperstone GmbH | Reichenaustr. 39a  | 78467 Konstanz
> Managing Director: Dr. Jan Peter Berns.
> Commercial register of local courts: Freiburg HRB381782
>

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

* Re: [PATCH 1/2] mmc: mmc_spi: parse speed mode options
  2022-03-31  7:28 [PATCH 1/2] mmc: mmc_spi: parse speed mode options Christian Löhle
  2022-03-31  7:29 ` [PATCH 2/2] mmc: mmc_spi: enable Highspeed for above 25MHz Christian Löhle
  2022-03-31 14:06 ` [PATCH 1/2] mmc: mmc_spi: parse speed mode options Andy Shevchenko
@ 2022-04-06 14:55 ` Ulf Hansson
  2 siblings, 0 replies; 7+ messages in thread
From: Ulf Hansson @ 2022-04-06 14:55 UTC (permalink / raw)
  To: Christian Löhle
  Cc: linux-kernel, linux-mmc, andriy.shevchenko, adrian.hunter,
	digetx, avri.altman

On Thu, 31 Mar 2022 at 09:28, Christian Löhle <CLoehle@hyperstone.com> wrote:
>
> Since SD and MMC Highspeed modes are also valid for SPI let's parse
> them too.
>
> Signed-off-by: Christian Loehle <cloehle@hyperstone.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/of_mmc_spi.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/mmc/host/of_mmc_spi.c b/drivers/mmc/host/of_mmc_spi.c
> index 3629550528b6..bf54776fb26c 100644
> --- a/drivers/mmc/host/of_mmc_spi.c
> +++ b/drivers/mmc/host/of_mmc_spi.c
> @@ -70,6 +70,10 @@ struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi)
>         } else {
>                 oms->pdata.caps |= MMC_CAP_NEEDS_POLL;
>         }
> +       if (device_property_read_bool(dev, "cap-sd-highspeed"))
> +               oms->pdata.caps |= MMC_CAP_SD_HIGHSPEED;
> +       if (device_property_read_bool(dev, "cap-mmc-highspeed"))
> +               oms->pdata.caps |= MMC_CAP_MMC_HIGHSPEED;
>
>         dev->platform_data = &oms->pdata;
>         return dev->platform_data;
> --
> 2.34.1
> Hyperstone GmbH | Reichenaustr. 39a  | 78467 Konstanz
> Managing Director: Dr. Jan Peter Berns.
> Commercial register of local courts: Freiburg HRB381782
>

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

end of thread, other threads:[~2022-04-06 16:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-31  7:28 [PATCH 1/2] mmc: mmc_spi: parse speed mode options Christian Löhle
2022-03-31  7:29 ` [PATCH 2/2] mmc: mmc_spi: enable Highspeed for above 25MHz Christian Löhle
2022-03-31 14:07   ` andriy.shevchenko
2022-04-05  9:20     ` Christian Löhle
2022-04-05 12:56       ` Ulf Hansson
2022-03-31 14:06 ` [PATCH 1/2] mmc: mmc_spi: parse speed mode options Andy Shevchenko
2022-04-06 14:55 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).