aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2015-03-25 21:18:23 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2015-03-27 05:34:12 -0400
commitf57ba4ca483a3e7d0ca31677f3baf036740c883b (patch)
tree3bc79582111166708e96b937085086e9367d05d3 /drivers/mmc
parent3a3ad3e9d54c968de1a26fe8ad5982f7ddec7e9f (diff)
mmc: omap_hsmmc: stop using ->enable|disable() callbacks
The ->enable|disable() callbacks are only used to get and put runtime PM references. Currently omap_hsmmc's ->set_ios() already does this itself. Other host drivers deals with runtime PM without using the ->enable|disable() callbacks and thus do the runtime PM reference counting themselves. Apply that approach for omap_hsmmc as well and then discard the ->enable|disable() callbacks. Signed-off-by: NeilBrown <neil@brown.name> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/omap_hsmmc.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 178931c335b4..833143f81451 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -864,6 +864,8 @@ static void omap_hsmmc_request_done(struct omap_hsmmc_host *host, struct mmc_req
864 return; 864 return;
865 host->mrq = NULL; 865 host->mrq = NULL;
866 mmc_request_done(host->mmc, mrq); 866 mmc_request_done(host->mmc, mrq);
867 pm_runtime_mark_last_busy(host->dev);
868 pm_runtime_put_autosuspend(host->dev);
867} 869}
868 870
869/* 871/*
@@ -1309,6 +1311,8 @@ static void omap_hsmmc_dma_callback(void *param)
1309 1311
1310 host->mrq = NULL; 1312 host->mrq = NULL;
1311 mmc_request_done(host->mmc, mrq); 1313 mmc_request_done(host->mmc, mrq);
1314 pm_runtime_mark_last_busy(host->dev);
1315 pm_runtime_put_autosuspend(host->dev);
1312 } 1316 }
1313} 1317}
1314 1318
@@ -1541,6 +1545,7 @@ static void omap_hsmmc_request(struct mmc_host *mmc, struct mmc_request *req)
1541 1545
1542 BUG_ON(host->req_in_progress); 1546 BUG_ON(host->req_in_progress);
1543 BUG_ON(host->dma_ch != -1); 1547 BUG_ON(host->dma_ch != -1);
1548 pm_runtime_get_sync(host->dev);
1544 if (host->protect_card) { 1549 if (host->protect_card) {
1545 if (host->reqs_blocked < 3) { 1550 if (host->reqs_blocked < 3) {
1546 /* 1551 /*
@@ -1557,6 +1562,8 @@ static void omap_hsmmc_request(struct mmc_host *mmc, struct mmc_request *req)
1557 req->data->error = -EBADF; 1562 req->data->error = -EBADF;
1558 req->cmd->retries = 0; 1563 req->cmd->retries = 0;
1559 mmc_request_done(mmc, req); 1564 mmc_request_done(mmc, req);
1565 pm_runtime_mark_last_busy(host->dev);
1566 pm_runtime_put_autosuspend(host->dev);
1560 return; 1567 return;
1561 } else if (host->reqs_blocked) 1568 } else if (host->reqs_blocked)
1562 host->reqs_blocked = 0; 1569 host->reqs_blocked = 0;
@@ -1570,6 +1577,8 @@ static void omap_hsmmc_request(struct mmc_host *mmc, struct mmc_request *req)
1570 req->data->error = err; 1577 req->data->error = err;
1571 host->mrq = NULL; 1578 host->mrq = NULL;
1572 mmc_request_done(mmc, req); 1579 mmc_request_done(mmc, req);
1580 pm_runtime_mark_last_busy(host->dev);
1581 pm_runtime_put_autosuspend(host->dev);
1573 return; 1582 return;
1574 } 1583 }
1575 if (req->sbc && !(host->flags & AUTO_CMD23)) { 1584 if (req->sbc && !(host->flags & AUTO_CMD23)) {
@@ -1773,25 +1782,6 @@ static void omap_hsmmc_conf_bus_power(struct omap_hsmmc_host *host)
1773 set_sd_bus_power(host); 1782 set_sd_bus_power(host);
1774} 1783}
1775 1784
1776static int omap_hsmmc_enable_fclk(struct mmc_host *mmc)
1777{
1778 struct omap_hsmmc_host *host = mmc_priv(mmc);
1779
1780 pm_runtime_get_sync(host->dev);
1781
1782 return 0;
1783}
1784
1785static int omap_hsmmc_disable_fclk(struct mmc_host *mmc)
1786{
1787 struct omap_hsmmc_host *host = mmc_priv(mmc);
1788
1789 pm_runtime_mark_last_busy(host->dev);
1790 pm_runtime_put_autosuspend(host->dev);
1791
1792 return 0;
1793}
1794
1795static int omap_hsmmc_multi_io_quirk(struct mmc_card *card, 1785static int omap_hsmmc_multi_io_quirk(struct mmc_card *card,
1796 unsigned int direction, int blk_size) 1786 unsigned int direction, int blk_size)
1797{ 1787{
@@ -1803,8 +1793,6 @@ static int omap_hsmmc_multi_io_quirk(struct mmc_card *card,
1803} 1793}
1804 1794
1805static struct mmc_host_ops omap_hsmmc_ops = { 1795static struct mmc_host_ops omap_hsmmc_ops = {
1806 .enable = omap_hsmmc_enable_fclk,
1807 .disable = omap_hsmmc_disable_fclk,
1808 .post_req = omap_hsmmc_post_req, 1796 .post_req = omap_hsmmc_post_req,
1809 .pre_req = omap_hsmmc_pre_req, 1797 .pre_req = omap_hsmmc_pre_req,
1810 .request = omap_hsmmc_request, 1798 .request = omap_hsmmc_request,