aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/mmci.c21
-rw-r--r--drivers/mmc/host/omap.c2
-rw-r--r--drivers/mmc/host/sdhci-tegra.c4
3 files changed, 24 insertions, 3 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 4602771658c0..50b5f9926f64 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -29,6 +29,7 @@
29#include <linux/dmaengine.h> 29#include <linux/dmaengine.h>
30#include <linux/dma-mapping.h> 30#include <linux/dma-mapping.h>
31#include <linux/amba/mmci.h> 31#include <linux/amba/mmci.h>
32#include <linux/pm_runtime.h>
32 33
33#include <asm/div64.h> 34#include <asm/div64.h>
34#include <asm/io.h> 35#include <asm/io.h>
@@ -170,6 +171,7 @@ mmci_request_end(struct mmci_host *host, struct mmc_request *mrq)
170 * back into the driver... 171 * back into the driver...
171 */ 172 */
172 spin_unlock(&host->lock); 173 spin_unlock(&host->lock);
174 pm_runtime_put(mmc_dev(host->mmc));
173 mmc_request_done(host->mmc, mrq); 175 mmc_request_done(host->mmc, mrq);
174 spin_lock(&host->lock); 176 spin_lock(&host->lock);
175} 177}
@@ -984,6 +986,8 @@ static void mmci_request(struct mmc_host *mmc, struct mmc_request *mrq)
984 return; 986 return;
985 } 987 }
986 988
989 pm_runtime_get_sync(mmc_dev(mmc));
990
987 spin_lock_irqsave(&host->lock, flags); 991 spin_lock_irqsave(&host->lock, flags);
988 992
989 host->mrq = mrq; 993 host->mrq = mrq;
@@ -1156,10 +1160,14 @@ static int __devinit mmci_probe(struct amba_device *dev,
1156 goto host_free; 1160 goto host_free;
1157 } 1161 }
1158 1162
1159 ret = clk_enable(host->clk); 1163 ret = clk_prepare(host->clk);
1160 if (ret) 1164 if (ret)
1161 goto clk_free; 1165 goto clk_free;
1162 1166
1167 ret = clk_enable(host->clk);
1168 if (ret)
1169 goto clk_unprep;
1170
1163 host->plat = plat; 1171 host->plat = plat;
1164 host->variant = variant; 1172 host->variant = variant;
1165 host->mclk = clk_get_rate(host->clk); 1173 host->mclk = clk_get_rate(host->clk);
@@ -1327,6 +1335,8 @@ static int __devinit mmci_probe(struct amba_device *dev,
1327 1335
1328 mmci_dma_setup(host); 1336 mmci_dma_setup(host);
1329 1337
1338 pm_runtime_put(&dev->dev);
1339
1330 mmc_add_host(mmc); 1340 mmc_add_host(mmc);
1331 1341
1332 return 0; 1342 return 0;
@@ -1345,6 +1355,8 @@ static int __devinit mmci_probe(struct amba_device *dev,
1345 iounmap(host->base); 1355 iounmap(host->base);
1346 clk_disable: 1356 clk_disable:
1347 clk_disable(host->clk); 1357 clk_disable(host->clk);
1358 clk_unprep:
1359 clk_unprepare(host->clk);
1348 clk_free: 1360 clk_free:
1349 clk_put(host->clk); 1361 clk_put(host->clk);
1350 host_free: 1362 host_free:
@@ -1364,6 +1376,12 @@ static int __devexit mmci_remove(struct amba_device *dev)
1364 if (mmc) { 1376 if (mmc) {
1365 struct mmci_host *host = mmc_priv(mmc); 1377 struct mmci_host *host = mmc_priv(mmc);
1366 1378
1379 /*
1380 * Undo pm_runtime_put() in probe. We use the _sync
1381 * version here so that we can access the primecell.
1382 */
1383 pm_runtime_get_sync(&dev->dev);
1384
1367 mmc_remove_host(mmc); 1385 mmc_remove_host(mmc);
1368 1386
1369 writel(0, host->base + MMCIMASK0); 1387 writel(0, host->base + MMCIMASK0);
@@ -1386,6 +1404,7 @@ static int __devexit mmci_remove(struct amba_device *dev)
1386 1404
1387 iounmap(host->base); 1405 iounmap(host->base);
1388 clk_disable(host->clk); 1406 clk_disable(host->clk);
1407 clk_unprepare(host->clk);
1389 clk_put(host->clk); 1408 clk_put(host->clk);
1390 1409
1391 if (host->vcc) 1410 if (host->vcc)
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index a6c329040140..2dba999caf2c 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -33,7 +33,7 @@
33 33
34#include <plat/board.h> 34#include <plat/board.h>
35#include <plat/mmc.h> 35#include <plat/mmc.h>
36#include <mach/gpio.h> 36#include <asm/gpio.h>
37#include <plat/dma.h> 37#include <plat/dma.h>
38#include <plat/mux.h> 38#include <plat/mux.h>
39#include <plat/fpga.h> 39#include <plat/fpga.h>
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index e9e061bf7d0c..067a4cded9cf 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -24,7 +24,9 @@
24#include <linux/mmc/host.h> 24#include <linux/mmc/host.h>
25#include <linux/module.h> 25#include <linux/module.h>
26 26
27#include <mach/gpio.h> 27#include <asm/gpio.h>
28
29#include <mach/gpio-tegra.h>
28#include <mach/sdhci.h> 30#include <mach/sdhci.h>
29 31
30#include "sdhci-pltfm.h" 32#include "sdhci-pltfm.h"