aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorSan Mehat <san@google.com>2009-11-23 18:36:31 -0500
committerDaniel Walker <dwalker@codeaurora.org>2010-03-18 16:37:16 -0400
commitf4748499d3dc5e7cadecb977f0d4f1f4f4a8d8c5 (patch)
tree92c72d2b309e67f12b8d0ad7516fa92efb3c2477 /drivers/mmc
parentc7fc9370df1433486dfa9460a833fae664e8be6c (diff)
mmc: msm_sdcc: Featurize busclock power save and disable it by default
Signed-off-by: San Mehat <san@google.com> Signed-off-by: Daniel Walker <dwalker@codeaurora.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/msm_sdcc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 591ef3c4e9a7..bdafb642a713 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -48,6 +48,7 @@
48 48
49#define DRIVER_NAME "msm-sdcc" 49#define DRIVER_NAME "msm-sdcc"
50 50
51#define BUSCLK_PWRSAVE 0
51#define BUSCLK_TIMEOUT (HZ) 52#define BUSCLK_TIMEOUT (HZ)
52static unsigned int msmsdcc_fmin = 144000; 53static unsigned int msmsdcc_fmin = 144000;
53static unsigned int msmsdcc_fmax = 50000000; 54static unsigned int msmsdcc_fmax = 50000000;
@@ -65,6 +66,8 @@ msmsdcc_disable_clocks(struct msmsdcc_host *host, int deferr)
65{ 66{
66 WARN_ON(!host->clks_on); 67 WARN_ON(!host->clks_on);
67 68
69 BUG_ON(host->curr.mrq);
70
68 if (deferr) { 71 if (deferr) {
69 mod_timer(&host->busclk_timer, jiffies + BUSCLK_TIMEOUT); 72 mod_timer(&host->busclk_timer, jiffies + BUSCLK_TIMEOUT);
70 } else { 73 } else {
@@ -131,7 +134,9 @@ msmsdcc_request_end(struct msmsdcc_host *host, struct mmc_request *mrq)
131 if (mrq->cmd->error == -ETIMEDOUT) 134 if (mrq->cmd->error == -ETIMEDOUT)
132 mdelay(5); 135 mdelay(5);
133 136
137#if BUSCLK_PWRSAVE
134 msmsdcc_disable_clocks(host, 1); 138 msmsdcc_disable_clocks(host, 1);
139#endif
135 /* 140 /*
136 * Need to drop the host lock here; mmc_request_done may call 141 * Need to drop the host lock here; mmc_request_done may call
137 * back into the driver... 142 * back into the driver...
@@ -257,7 +262,9 @@ msmsdcc_dma_complete_func(struct msm_dmov_cmd *cmd,
257 mrq->data->bytes_xfered = host->curr.data_xfered; 262 mrq->data->bytes_xfered = host->curr.data_xfered;
258 263
259 spin_unlock_irqrestore(&host->lock, flags); 264 spin_unlock_irqrestore(&host->lock, flags);
265#if BUSCLK_PWRSAVE
260 msmsdcc_disable_clocks(host, 1); 266 msmsdcc_disable_clocks(host, 1);
267#endif
261 mmc_request_done(host->mmc, mrq); 268 mmc_request_done(host->mmc, mrq);
262 return; 269 return;
263 } else 270 } else
@@ -934,7 +941,9 @@ msmsdcc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
934 host->pwr = pwr; 941 host->pwr = pwr;
935 msmsdcc_writel(host, pwr, MMCIPOWER); 942 msmsdcc_writel(host, pwr, MMCIPOWER);
936 } 943 }
944#if BUSCLK_PWRSAVE
937 msmsdcc_disable_clocks(host, 1); 945 msmsdcc_disable_clocks(host, 1);
946#endif
938 spin_unlock_irqrestore(&host->lock, flags); 947 spin_unlock_irqrestore(&host->lock, flags);
939} 948}
940 949
@@ -1279,7 +1288,9 @@ msmsdcc_probe(struct platform_device *pdev)
1279 if (host->timer.function) 1288 if (host->timer.function)
1280 pr_info("%s: Polling status mode enabled\n", mmc_hostname(mmc)); 1289 pr_info("%s: Polling status mode enabled\n", mmc_hostname(mmc));
1281 1290
1291#if BUSCLK_PWRSAVE
1282 msmsdcc_disable_clocks(host, 1); 1292 msmsdcc_disable_clocks(host, 1);
1293#endif
1283 return 0; 1294 return 0;
1284 cmd_irq_free: 1295 cmd_irq_free:
1285 free_irq(cmd_irqres->start, host); 1296 free_irq(cmd_irqres->start, host);
@@ -1341,7 +1352,9 @@ msmsdcc_resume(struct platform_device *dev)
1341 mmc_resume_host(mmc); 1352 mmc_resume_host(mmc);
1342 if (host->stat_irq) 1353 if (host->stat_irq)
1343 enable_irq(host->stat_irq); 1354 enable_irq(host->stat_irq);
1355#if BUSCLK_PWRSAVE
1344 msmsdcc_disable_clocks(host, 1); 1356 msmsdcc_disable_clocks(host, 1);
1357#endif
1345 } 1358 }
1346 return 0; 1359 return 0;
1347} 1360}