Commit 5ffdeea5 authored by Ulf Hansson's avatar Ulf Hansson Committed by Chris Ball

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: default avatarUlf Hansson <ulf.hansson@linaro.org>
Signed-off-by: default avatarChris Ball <cjb@laptop.org>
parent d978a2b6
...@@ -193,7 +193,6 @@ struct mmc_davinci_host { ...@@ -193,7 +193,6 @@ struct mmc_davinci_host {
#define DAVINCI_MMC_DATADIR_READ 1 #define DAVINCI_MMC_DATADIR_READ 1
#define DAVINCI_MMC_DATADIR_WRITE 2 #define DAVINCI_MMC_DATADIR_WRITE 2
unsigned char data_dir; unsigned char data_dir;
unsigned char suspended;
/* buffer is used during PIO of one scatterlist segment, and /* buffer is used during PIO of one scatterlist segment, and
* is updated along with buffer_bytes_left. bytes_left applies * is updated along with buffer_bytes_left. bytes_left applies
...@@ -1435,38 +1434,23 @@ static int davinci_mmcsd_suspend(struct device *dev) ...@@ -1435,38 +1434,23 @@ static int davinci_mmcsd_suspend(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct mmc_davinci_host *host = platform_get_drvdata(pdev); struct mmc_davinci_host *host = platform_get_drvdata(pdev);
int ret;
ret = mmc_suspend_host(host->mmc); writel(0, host->base + DAVINCI_MMCIM);
if (!ret) { mmc_davinci_reset_ctrl(host, 1);
writel(0, host->base + DAVINCI_MMCIM); clk_disable(host->clk);
mmc_davinci_reset_ctrl(host, 1);
clk_disable(host->clk);
host->suspended = 1;
} else {
host->suspended = 0;
}
return ret; return 0;
} }
static int davinci_mmcsd_resume(struct device *dev) static int davinci_mmcsd_resume(struct device *dev)
{ {
struct platform_device *pdev = to_platform_device(dev); struct platform_device *pdev = to_platform_device(dev);
struct mmc_davinci_host *host = platform_get_drvdata(pdev); struct mmc_davinci_host *host = platform_get_drvdata(pdev);
int ret;
if (!host->suspended)
return 0;
clk_enable(host->clk); clk_enable(host->clk);
mmc_davinci_reset_ctrl(host, 0); mmc_davinci_reset_ctrl(host, 0);
ret = mmc_resume_host(host->mmc);
if (!ret)
host->suspended = 0;
return ret; return 0;
} }
static const struct dev_pm_ops davinci_mmcsd_pm = { static const struct dev_pm_ops davinci_mmcsd_pm = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment