diff options
author | Ulf Hansson <ulf.hansson@linaro.org> | 2013-09-25 06:29:19 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2013-10-30 20:26:38 -0400 |
commit | 5ffdeea522c8349ac96a11ec8e19486354fda808 (patch) | |
tree | 260490e978a276951b3967d272eac865e5110bdc /drivers/mmc | |
parent | d978a2b631506bd0501ceb185a21d23cd63b8790 (diff) |
mmc: davinci_mmc: Move away from using deprecated APIs
Suspend and resume of cards are being handled from the protocol layer
and consequently the mmc_suspend|resume_host APIs are deprecated.
This means we can simplify the suspend|resume callbacks by removing the
use of the deprecated APIs.
Cc: Sekhar Nori <nsekhar@ti.com>
Cc: Manjunathappa, Prakash <prakash.pm@ti.com>
Cc: davinci-linux-open-source@linux.davincidsp.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r-- | drivers/mmc/host/davinci_mmc.c | 26 |
1 files changed, 5 insertions, 21 deletions
diff --git a/drivers/mmc/host/davinci_mmc.c b/drivers/mmc/host/davinci_mmc.c index e9fa87df909c..d6153740b77f 100644 --- a/drivers/mmc/host/davinci_mmc.c +++ b/drivers/mmc/host/davinci_mmc.c | |||
@@ -193,7 +193,6 @@ struct mmc_davinci_host { | |||
193 | #define DAVINCI_MMC_DATADIR_READ 1 | 193 | #define DAVINCI_MMC_DATADIR_READ 1 |
194 | #define DAVINCI_MMC_DATADIR_WRITE 2 | 194 | #define DAVINCI_MMC_DATADIR_WRITE 2 |
195 | unsigned char data_dir; | 195 | unsigned char data_dir; |
196 | unsigned char suspended; | ||
197 | 196 | ||
198 | /* buffer is used during PIO of one scatterlist segment, and | 197 | /* buffer is used during PIO of one scatterlist segment, and |
199 | * is updated along with buffer_bytes_left. bytes_left applies | 198 | * is updated along with buffer_bytes_left. bytes_left applies |
@@ -1435,38 +1434,23 @@ static int davinci_mmcsd_suspend(struct device *dev) | |||
1435 | { | 1434 | { |
1436 | struct platform_device *pdev = to_platform_device(dev); | 1435 | struct platform_device *pdev = to_platform_device(dev); |
1437 | struct mmc_davinci_host *host = platform_get_drvdata(pdev); | 1436 | struct mmc_davinci_host *host = platform_get_drvdata(pdev); |
1438 | int ret; | ||
1439 | 1437 | ||
1440 | ret = mmc_suspend_host(host->mmc); | 1438 | writel(0, host->base + DAVINCI_MMCIM); |
1441 | if (!ret) { | 1439 | mmc_davinci_reset_ctrl(host, 1); |
1442 | writel(0, host->base + DAVINCI_MMCIM); | 1440 | clk_disable(host->clk); |
1443 | mmc_davinci_reset_ctrl(host, 1); | ||
1444 | clk_disable(host->clk); | ||
1445 | host->suspended = 1; | ||
1446 | } else { | ||
1447 | host->suspended = 0; | ||
1448 | } | ||
1449 | 1441 | ||
1450 | return ret; | 1442 | return 0; |
1451 | } | 1443 | } |
1452 | 1444 | ||
1453 | static int davinci_mmcsd_resume(struct device *dev) | 1445 | static int davinci_mmcsd_resume(struct device *dev) |
1454 | { | 1446 | { |
1455 | struct platform_device *pdev = to_platform_device(dev); | 1447 | struct platform_device *pdev = to_platform_device(dev); |
1456 | struct mmc_davinci_host *host = platform_get_drvdata(pdev); | 1448 | struct mmc_davinci_host *host = platform_get_drvdata(pdev); |
1457 | int ret; | ||
1458 | |||
1459 | if (!host->suspended) | ||
1460 | return 0; | ||
1461 | 1449 | ||
1462 | clk_enable(host->clk); | 1450 | clk_enable(host->clk); |
1463 | |||
1464 | mmc_davinci_reset_ctrl(host, 0); | 1451 | mmc_davinci_reset_ctrl(host, 0); |
1465 | ret = mmc_resume_host(host->mmc); | ||
1466 | if (!ret) | ||
1467 | host->suspended = 0; | ||
1468 | 1452 | ||
1469 | return ret; | 1453 | return 0; |
1470 | } | 1454 | } |
1471 | 1455 | ||
1472 | static const struct dev_pm_ops davinci_mmcsd_pm = { | 1456 | static const struct dev_pm_ops davinci_mmcsd_pm = { |