aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>2011-03-09 14:45:44 +0100
committerChris Ball <cjb@laptop.org>2011-03-25 10:39:59 -0400
commit5fd0157901d5a8f497f3d3b95cb4beebf1641d1b (patch)
tree5604735371eb07f4a579ad66ceab3048f230c81f /drivers
parenta7edbe399b40fb82ccd11216fd88d24e428025c5 (diff)
mmc: tmio: support aggressive clock gating
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Acked-by: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/tmio_mmc_pio.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index 69772ab3ca2..e35e17992e3 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -747,19 +747,18 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
tmio_mmc_set_clock(host, ios->clock);
/* Power sequence - OFF -> UP -> ON */
- switch (ios->power_mode) {
- case MMC_POWER_OFF: /* power down SD bus */
- if (host->set_pwr)
+ if (ios->power_mode == MMC_POWER_OFF || !ios->clock) {
+ /* power down SD bus */
+ if (ios->power_mode == MMC_POWER_OFF && host->set_pwr)
host->set_pwr(host->pdev, 0);
tmio_mmc_clk_stop(host);
- break;
- case MMC_POWER_ON: /* start bus clock */
- tmio_mmc_clk_start(host);
- break;
- case MMC_POWER_UP: /* power up SD bus */
+ } else if (ios->power_mode == MMC_POWER_UP) {
+ /* power up SD bus */
if (host->set_pwr)
host->set_pwr(host->pdev, 1);
- break;
+ } else {
+ /* start bus clock */
+ tmio_mmc_clk_start(host);
}
switch (ios->bus_width) {