From 9e5f037176f3ee2a5b6b33681ad7ee2a5b410e36 Mon Sep 17 00:00:00 2001 From: Pavan Kunapuli Date: Thu, 13 Oct 2011 20:18:54 +0530 Subject: sdhci: tegra: Switch OFF/ON power rails in suspend/resume Switching OFF the sd power rails in suspend and switching them ON in resume. Change-Id: I5145e211111b8144f14ee0338388eeacb34bb003 Reviewed-on: http://git-master/r/57877 Tested-by: Pavan Kunapuli Reviewed-by: Sachin Nikam Reviewed-by: Laxman Dewangan Rebase-Id: R527ae8de0561bfedd3afb2fce62ad4d2876575bc --- drivers/mmc/host/sdhci-tegra.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'drivers/mmc/host/sdhci-tegra.c') diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c index 525e8bf59df1..1b4739e64735 100644 --- a/drivers/mmc/host/sdhci-tegra.c +++ b/drivers/mmc/host/sdhci-tegra.c @@ -288,13 +288,30 @@ static void tegra_sdhci_set_clock(struct sdhci_host *sdhci, unsigned int clock) static int tegra_sdhci_suspend(struct sdhci_host *sdhci, pm_message_t state) { + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(sdhci); + struct tegra_sdhci_host *tegra_host = pltfm_host->priv; + tegra_sdhci_set_clock(sdhci, 0); + /* Disable the power rails if any */ + if (tegra_host->vdd_slot_reg) + regulator_disable(tegra_host->vdd_slot_reg); + if (tegra_host->vdd_io_reg) + regulator_disable(tegra_host->vdd_io_reg); return 0; } static int tegra_sdhci_resume(struct sdhci_host *sdhci) { + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(sdhci); + struct tegra_sdhci_host *tegra_host = pltfm_host->priv; + + /* Enable the power rails if any */ + if (tegra_host->vdd_io_reg) + regulator_enable(tegra_host->vdd_io_reg); + if (tegra_host->vdd_slot_reg) + regulator_enable(tegra_host->vdd_slot_reg); + /* Setting the min identification clock of freq 400KHz */ tegra_sdhci_set_clock(sdhci, 400000); -- cgit v1.2.3