diff mbox

[6/7] mmc: sdhci: add regulator notifier for vqmmc

Message ID 1359536388-7896-7-git-send-email-kliu5@marvell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kevin Liu Jan. 30, 2013, 8:59 a.m. UTC
Some soc/platform need specific handling for signal voltage
switch. For example, mmp2/mmp3 need to set the AIB IO domain
control register accordingly.
Use regulator notifier to do this.

Signed-off-by: Philip Rakity <prakity@marvell.com>
Signed-off-by: Kevin Liu <kliu5@marvell.com>
---
 drivers/mmc/host/sdhci.c  |    6 ++++++
 include/linux/mmc/sdhci.h |    1 +
 2 files changed, 7 insertions(+)
diff mbox

Patch

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 81a4bfa..107ac15 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2944,6 +2944,9 @@  int sdhci_add_host(struct sdhci_host *host)
 			caps[1] &= ~(SDHCI_SUPPORT_SDR104 |
 					SDHCI_SUPPORT_SDR50 |
 					SDHCI_SUPPORT_DDR50);
+		if (host->nb_vqmmc)
+			regulator_register_notifier(host->vqmmc,
+				host->nb_vqmmc);
 	}
 
 	if (host->quirks2 & SDHCI_QUIRK2_NO_1_8_V)
@@ -3265,6 +3268,9 @@  void sdhci_remove_host(struct sdhci_host *host, int dead)
 	}
 
 	if (host->vqmmc) {
+		if (host->nb_vqmmc)
+			regulator_unregister_notifier(host->vqmmc,
+				host->nb_vqmmc);
 		regulator_disable(host->vqmmc);
 		regulator_put(host->vqmmc);
 	}
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index b838ffc..c3ef3b6 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -103,6 +103,7 @@  struct sdhci_host {
 
 	struct regulator *vmmc;		/* Power regulator (vmmc) */
 	struct regulator *vqmmc;	/* Signaling regulator (vccq) */
+	struct notifier_block	*nb_vqmmc;	/* Regulator notifier (vccq) */
 
 	/* Internal data */
 	struct mmc_host *mmc;	/* MMC structure */