diff options
| author | Eric Bénard <eric@eukrea.com> | 2010-06-17 14:59:07 -0400 |
|---|---|---|
| committer | Sascha Hauer <s.hauer@pengutronix.de> | 2010-07-26 08:29:21 -0400 |
| commit | a7d403cfd1a4c8924874e0f6b600edb7f38684d0 (patch) | |
| tree | 7b5ed459d186cf87e287120652bb1167e7b27e08 | |
| parent | d5efe2551e3ea88d9446f0d9d073debbb847f6af (diff) | |
mxcmmc: convert to pm_ops and enable/disable clock
Signed-off-by: Eric Bénard <eric@eukrea.com>
Cc: s.hauer@pengutronix.de
Cc: linux-mmc@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| -rw-r--r-- | drivers/mmc/host/mxcmmc.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/drivers/mmc/host/mxcmmc.c b/drivers/mmc/host/mxcmmc.c index fdf33e837a73..350f78e86245 100644 --- a/drivers/mmc/host/mxcmmc.c +++ b/drivers/mmc/host/mxcmmc.c | |||
| @@ -936,43 +936,47 @@ static int mxcmci_remove(struct platform_device *pdev) | |||
| 936 | } | 936 | } |
| 937 | 937 | ||
| 938 | #ifdef CONFIG_PM | 938 | #ifdef CONFIG_PM |
| 939 | static int mxcmci_suspend(struct platform_device *dev, pm_message_t state) | 939 | static int mxcmci_suspend(struct device *dev) |
| 940 | { | 940 | { |
| 941 | struct mmc_host *mmc = platform_get_drvdata(dev); | 941 | struct mmc_host *mmc = dev_get_drvdata(dev); |
| 942 | struct mxcmci_host *host = mmc_priv(mmc); | ||
| 942 | int ret = 0; | 943 | int ret = 0; |
| 943 | 944 | ||
| 944 | if (mmc) | 945 | if (mmc) |
| 945 | ret = mmc_suspend_host(mmc); | 946 | ret = mmc_suspend_host(mmc); |
| 947 | clk_disable(host->clk); | ||
| 946 | 948 | ||
| 947 | return ret; | 949 | return ret; |
| 948 | } | 950 | } |
| 949 | 951 | ||
| 950 | static int mxcmci_resume(struct platform_device *dev) | 952 | static int mxcmci_resume(struct device *dev) |
| 951 | { | 953 | { |
| 952 | struct mmc_host *mmc = platform_get_drvdata(dev); | 954 | struct mmc_host *mmc = dev_get_drvdata(dev); |
| 953 | struct mxcmci_host *host; | 955 | struct mxcmci_host *host = mmc_priv(mmc); |
| 954 | int ret = 0; | 956 | int ret = 0; |
| 955 | 957 | ||
| 956 | if (mmc) { | 958 | clk_enable(host->clk); |
| 957 | host = mmc_priv(mmc); | 959 | if (mmc) |
| 958 | ret = mmc_resume_host(mmc); | 960 | ret = mmc_resume_host(mmc); |
| 959 | } | ||
| 960 | 961 | ||
| 961 | return ret; | 962 | return ret; |
| 962 | } | 963 | } |
| 963 | #else | 964 | |
| 964 | #define mxcmci_suspend NULL | 965 | static const struct dev_pm_ops mxcmci_pm_ops = { |
| 965 | #define mxcmci_resume NULL | 966 | .suspend = mxcmci_suspend, |
| 966 | #endif /* CONFIG_PM */ | 967 | .resume = mxcmci_resume, |
| 968 | }; | ||
| 969 | #endif | ||
| 967 | 970 | ||
| 968 | static struct platform_driver mxcmci_driver = { | 971 | static struct platform_driver mxcmci_driver = { |
| 969 | .probe = mxcmci_probe, | 972 | .probe = mxcmci_probe, |
| 970 | .remove = mxcmci_remove, | 973 | .remove = mxcmci_remove, |
| 971 | .suspend = mxcmci_suspend, | ||
| 972 | .resume = mxcmci_resume, | ||
| 973 | .driver = { | 974 | .driver = { |
| 974 | .name = DRIVER_NAME, | 975 | .name = DRIVER_NAME, |
| 975 | .owner = THIS_MODULE, | 976 | .owner = THIS_MODULE, |
| 977 | #ifdef CONFIG_PM | ||
| 978 | .pm = &mxcmci_pm_ops, | ||
| 979 | #endif | ||
| 976 | } | 980 | } |
| 977 | }; | 981 | }; |
| 978 | 982 | ||
