Skip to contentSkip to conversation

mmc: sdhci: UHS-II support, handle vdd2 in case of power-off

RFC PATCH In review Ben Chuang 3 participants 3 messages Jul 10, 2020 – Sep 15, 2020

Subsystems (2)
lore
Share & tools
lore

Ben Chuang

author
#0 lore raw

RFC PATCH v3 14/21 mmc: sdhci: UHS-II support, handle vdd2 in case of power-off

From: AKASHI Takahiro <[email protected]>

Configure a regulator for VDD2 in case of power-off.

---
 drivers/mmc/host/sdhci.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/mmc/host/sdhci.c +5 -0
index 7f2537648a08..d38d734ec83f 100644
@@ -2333,6 +2333,11 @@ void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		if (!IS_ERR(mmc->supply.vmmc) &&
 		    ios->power_mode == MMC_POWER_OFF)
 			mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
+		if (IS_ENABLED(CONFIG_MMC_SDHCI_UHS2) &&
+		    host->mmc->caps & MMC_CAP_UHS2 &&
+		    !IS_ERR(mmc->supply.vmmc2) &&
+		    ios->power_mode == MMC_POWER_OFF)
+			mmc_regulator_set_ocr(mmc, mmc->supply.vmmc2, 0);
 		return;
 	}
 
Signature · 1 line
2.27.0
maintainer
#1 lore raw
Quoted 15 lines · Ben Chuang

From: AKASHI Takahiro <[email protected]>

Configure a regulator for VDD2 in case of power-off.

---
 drivers/mmc/host/sdhci.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/mmc/host/sdhci.c +0 -0
index 7f2537648a08..d38d734ec83f 100644

drivers/mmc/host/sdhci.c void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) · line 2339

Quoted 7 lines
drivers/mmc/host/sdhci.c +4 -0
@@ -2333,6 +2333,11 @@ void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		if (!IS_ERR(mmc->supply.vmmc) &&
 		    ios->power_mode == MMC_POWER_OFF)
 			mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
+		if (IS_ENABLED(CONFIG_MMC_SDHCI_UHS2) &&
+		    host->mmc->caps & MMC_CAP_UHS2 &&
+		    !IS_ERR(mmc->supply.vmmc2) &&
+		    ios->power_mode == MMC_POWER_OFF)

Probably this can be just:

		if (!IS_ERR_OR_NULL(mmc->supply.vmmc2) &&
		    ios->power_mode == MMC_POWER_OFF)
Quoted 5 lines
drivers/mmc/host/sdhci.c +1 -0
+			mmc_regulator_set_ocr(mmc, mmc->supply.vmmc2, 0);
 		return;
 	}
 
#2 lore raw
Quoted 26 lines · Adrian Hunter
Quoted 15 lines · Ben Chuang

From: AKASHI Takahiro <[email protected]>

Configure a regulator for VDD2 in case of power-off.

---
 drivers/mmc/host/sdhci.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/mmc/host/sdhci.c +0 -0
index 7f2537648a08..d38d734ec83f 100644

drivers/mmc/host/sdhci.c void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) · line 2339

Quoted 7 lines
drivers/mmc/host/sdhci.c +4 -0
@@ -2333,6 +2333,11 @@ void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 		if (!IS_ERR(mmc->supply.vmmc) &&
 		    ios->power_mode == MMC_POWER_OFF)
 			mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, 0);
+		if (IS_ENABLED(CONFIG_MMC_SDHCI_UHS2) &&
+		    host->mmc->caps & MMC_CAP_UHS2 &&
+		    !IS_ERR(mmc->supply.vmmc2) &&
+		    ios->power_mode == MMC_POWER_OFF)

Probably this can be just:

Quoted 2 lines
		if (!IS_ERR_OR_NULL(mmc->supply.vmmc2) &&
		    ios->power_mode == MMC_POWER_OFF)

Yeah, probably.

-Takahiro Akashi

Quoted 7 lines
Quoted 6 lines
drivers/mmc/host/sdhci.c +1 -0
+			mmc_regulator_set_ocr(mmc, mmc->supply.vmmc2, 0);
 		return;
 	}