aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/mmci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/host/mmci.c')
-rw-r--r--drivers/mmc/host/mmci.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 56e9a4168264..5e142b7f5ecf 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;
@@ -1327,6 +1331,8 @@ static int __devinit mmci_probe(struct amba_device *dev,
1327 1331
1328 mmci_dma_setup(host); 1332 mmci_dma_setup(host);
1329 1333
1334 pm_runtime_put(&dev->dev);
1335
1330 mmc_add_host(mmc); 1336 mmc_add_host(mmc);
1331 1337
1332 return 0; 1338 return 0;
@@ -1364,6 +1370,12 @@ static int __devexit mmci_remove(struct amba_device *dev)
1364 if (mmc) { 1370 if (mmc) {
1365 struct mmci_host *host = mmc_priv(mmc); 1371 struct mmci_host *host = mmc_priv(mmc);
1366 1372
1373 /*
1374 * Undo pm_runtime_put() in probe. We use the _sync
1375 * version here so that we can access the primecell.
1376 */
1377 pm_runtime_get_sync(&dev->dev);
1378
1367 mmc_remove_host(mmc); 1379 mmc_remove_host(mmc);
1368 1380
1369 writel(0, host->base + MMCIMASK0); 1381 writel(0, host->base + MMCIMASK0);