diff mbox series

mmc: sdhci: Setup HS modes based on HISPD bit

Message ID acc97ac11e4c2c5330885c039e4db99261a3c0fb.1596034654.git.michal.simek@xilinx.com
State Accepted
Commit 620bb46eaddd8f8ee361b47e56d57fd50a29b005
Delegated to: Peng Fan
Headers show
Series mmc: sdhci: Setup HS modes based on HISPD bit | expand

Commit Message

Michal Simek July 29, 2020, 2:57 p.m. UTC
There is no reason to setup HS modes by default without checking bit in
capability register.
Setting up HS mode by default breaks option to disable HS mode via
sdhci-caps-mask DT property.

Disabling HS mode can be done via DT as:
sdhci-caps-mask = <0 0x200000>;

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 drivers/mmc/sdhci.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Faiz Abbas July 29, 2020, 3:02 p.m. UTC | #1
Hi,

On 29/07/20 8:27 pm, Michal Simek wrote:
> There is no reason to setup HS modes by default without checking bit in
> capability register.
> Setting up HS mode by default breaks option to disable HS mode via
> sdhci-caps-mask DT property.
> 
> Disabling HS mode can be done via DT as:
> sdhci-caps-mask = <0 0x200000>;
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> 

I've already posted this fix here:
https://patchwork.ozlabs.org/project/uboot/patch/20200723041219.2438-1-faiz_abbas@ti.com/

Thanks,
Faiz
Michal Simek July 29, 2020, 3:07 p.m. UTC | #2
On 29. 07. 20 17:02, Faiz Abbas wrote:
> Hi,
> 
> On 29/07/20 8:27 pm, Michal Simek wrote:
>> There is no reason to setup HS modes by default without checking bit in
>> capability register.
>> Setting up HS mode by default breaks option to disable HS mode via
>> sdhci-caps-mask DT property.
>>
>> Disabling HS mode can be done via DT as:
>> sdhci-caps-mask = <0 0x200000>;
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
> 
> I've already posted this fix here:
> https://patchwork.ozlabs.org/project/uboot/patch/20200723041219.2438-1-faiz_abbas@ti.com/

Wonderful. Please ignore this patch and take Faiz one.

Thanks,
Michal
diff mbox series

Patch

diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
index 9af4de84dd6b..2119fdbae840 100644
--- a/drivers/mmc/sdhci.c
+++ b/drivers/mmc/sdhci.c
@@ -844,7 +844,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) {