Skip to contentSkip to conversation

mmc: sdhci: Set SDHCI_POWER_ON with external vmmc

PATCH Applied Tim Kryger 3 participants 3 messages Jan 14, 2015 – Feb 10, 2015

Subsystems (2)
lore
Share & tools
lore

Tim Kryger

author
#0 lore raw

PATCH 1/1 mmc: sdhci: Set SDHCI_POWER_ON with external vmmc

Host controllers lacking the required internal vmmc regulator may still follow the spec with regard to the LSB of SDHCI_POWER_CONTROL. Set the SDHCI_POWER_ON bit when vmmc is enabled to encourage the controller to to drive CMD, DAT, SDCLK.

This fixes a regression observed on some Qualcomm and Nvidia boards caused by 5222161 mmc: sdhci: Improve external VDD regulator support.

---
 drivers/mmc/host/sdhci.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mmc/host/sdhci.c +6 -0
index ada1a3e..59a328a 100644
@@ -1239,6 +1239,12 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned char mode,
 		spin_unlock_irq(&host->lock);
 		mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
 		spin_lock_irq(&host->lock);
+
+		if (mode != MMC_POWER_OFF)
+			sdhci_writeb(host, SDHCI_POWER_ON, SDHCI_POWER_CONTROL);
+		else
+			sdhci_writeb(host, 0, SDHCI_POWER_CONTROL);
+
 		return;
 	}
 
Signature · 1 line
1.9.1
Applied
#1 lore raw

+ linux-mmc

Quoted 10 lines · Tim Kryger

Host controllers lacking the required internal vmmc regulator may still follow the spec with regard to the LSB of SDHCI_POWER_CONTROL. Set the SDHCI_POWER_ON bit when vmmc is enabled to encourage the controller to to drive CMD, DAT, SDCLK.

This fixes a regression observed on some Qualcomm and Nvidia boards caused by 5222161 mmc: sdhci: Improve external VDD regulator support.

Thanks! Applied for fixes.

I noticed this wasn't posted to linux-mmc. I am anyway picking it up as this change has already been discussed and tested, see:
https://lkml.org/lkml/2014/11/3/1029

Kind regards
Uffe

Quoted 24 lines
---
 drivers/mmc/host/sdhci.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/mmc/host/sdhci.c +6 -1
index ada1a3e..59a328a 100644
@@ -1239,6 +1239,12 @@ static void sdhci_set_power(struct sdhci_host *host, unsigned char mode,
                spin_unlock_irq(&host->lock);
                mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd);
                spin_lock_irq(&host->lock);
+
+               if (mode != MMC_POWER_OFF)
+                       sdhci_writeb(host, SDHCI_POWER_ON, SDHCI_POWER_CONTROL);
+               else
+                       sdhci_writeb(host, 0, SDHCI_POWER_CONTROL);
+
                return;
        }
 
--

1.9.1

#2 lore raw
Quoted 11 lines · Ulf Hansson

+ linux-mmc

Quoted 8 lines · Tim Kryger

Host controllers lacking the required internal vmmc regulator may still follow the spec with regard to the LSB of SDHCI_POWER_CONTROL. Set the SDHCI_POWER_ON bit when vmmc is enabled to encourage the controller to to drive CMD, DAT, SDCLK.

This fixes a regression observed on some Qualcomm and Nvidia boards caused by 5222161 mmc: sdhci: Improve external VDD regulator support.

Quoted 8 lines
Quoted 2 lines

Thanks! Applied for fixes.

I noticed this wasn't posted to linux-mmc. I am anyway picking it up as this change has already been discussed and tested, see:
https://lkml.org/lkml/2014/11/3/1029

The party is probably over for this patch, but FWIW: