[PATCH 2/2] mmc: mmc_spi: enable Highspeed for above 25MHz

From: Christian Löhle
Date: Thu Mar 31 2022 - 03:29:46 EST


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@xxxxxxxxxxxxxx>
---
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