aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-04-25 07:59:46 -0400
committerChris Ball <chris@printf.net>2014-05-22 08:33:27 -0400
commit723f7924e80e97e365e70206b6f6f5ebdd8e7ccf (patch)
tree07f234ffadce12d46a1dd9f98d21ed359fd705ac /drivers/mmc
parent850a29b859407e4c35252c817d542f95bf4a5771 (diff)
mmc: sdhci-of-esdhc: remove platform_suspend/platform_resume callbacks
We don't need these hooks in order to insert code in these paths, we can just provide our own handlers and call the main sdhci handlers as appropriate. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Tested-by: Markus Pargmann <mpa@pengutronix.de> Tested-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <chris@printf.net>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci-of-esdhc.c55
1 files changed, 36 insertions, 19 deletions
diff --git a/drivers/mmc/host/sdhci-of-esdhc.c b/drivers/mmc/host/sdhci-of-esdhc.c
index fcaeae5f55b8..605815e52f5f 100644
--- a/drivers/mmc/host/sdhci-of-esdhc.c
+++ b/drivers/mmc/host/sdhci-of-esdhc.c
@@ -241,20 +241,6 @@ static void esdhc_of_set_clock(struct sdhci_host *host, unsigned int clock)
241 mdelay(1); 241 mdelay(1);
242} 242}
243 243
244#ifdef CONFIG_PM
245static u32 esdhc_proctl;
246static void esdhc_of_suspend(struct sdhci_host *host)
247{
248 esdhc_proctl = sdhci_be32bs_readl(host, SDHCI_HOST_CONTROL);
249}
250
251static void esdhc_of_resume(struct sdhci_host *host)
252{
253 esdhc_of_enable_dma(host);
254 sdhci_be32bs_writel(host, esdhc_proctl, SDHCI_HOST_CONTROL);
255}
256#endif
257
258static void esdhc_of_platform_init(struct sdhci_host *host) 244static void esdhc_of_platform_init(struct sdhci_host *host)
259{ 245{
260 u32 vvn; 246 u32 vvn;
@@ -302,16 +288,47 @@ static const struct sdhci_ops sdhci_esdhc_ops = {
302 .get_max_clock = esdhc_of_get_max_clock, 288 .get_max_clock = esdhc_of_get_max_clock,
303 .get_min_clock = esdhc_of_get_min_clock, 289 .get_min_clock = esdhc_of_get_min_clock,
304 .platform_init = esdhc_of_platform_init, 290 .platform_init = esdhc_of_platform_init,
305#ifdef CONFIG_PM
306 .platform_suspend = esdhc_of_suspend,
307 .platform_resume = esdhc_of_resume,
308#endif
309 .adma_workaround = esdhci_of_adma_workaround, 291 .adma_workaround = esdhci_of_adma_workaround,
310 .set_bus_width = esdhc_pltfm_set_bus_width, 292 .set_bus_width = esdhc_pltfm_set_bus_width,
311 .reset = sdhci_reset, 293 .reset = sdhci_reset,
312 .set_uhs_signaling = sdhci_set_uhs_signaling, 294 .set_uhs_signaling = sdhci_set_uhs_signaling,
313}; 295};
314 296
297#ifdef CONFIG_PM
298
299static u32 esdhc_proctl;
300static int esdhc_of_suspend(struct device *dev)
301{
302 struct sdhci_host *host = dev_get_drvdata(dev);
303
304 esdhc_proctl = sdhci_be32bs_readl(host, SDHCI_HOST_CONTROL);
305
306 return sdhci_suspend_host(host);
307}
308
309static void esdhc_of_resume(device *dev)
310{
311 struct sdhci_host *host = dev_get_drvdata(dev);
312 int ret = sdhci_resume_host(host);
313
314 if (ret == 0) {
315 /* Isn't this already done by sdhci_resume_host() ? --rmk */
316 esdhc_of_enable_dma(host);
317 sdhci_be32bs_writel(host, esdhc_proctl, SDHCI_HOST_CONTROL);
318 }
319
320 return ret;
321}
322
323static const struct dev_pm_ops esdhc_pmops = {
324 .suspend = esdhci_of_suspend,
325 .resume = esdhci_of_resume,
326};
327#define ESDHC_PMOPS (&esdhc_pmops)
328#else
329#define ESDHC_PMOPS NULL
330#endif
331
315static const struct sdhci_pltfm_data sdhci_esdhc_pdata = { 332static const struct sdhci_pltfm_data sdhci_esdhc_pdata = {
316 /* 333 /*
317 * card detection could be handled via GPIO 334 * card detection could be handled via GPIO
@@ -373,7 +390,7 @@ static struct platform_driver sdhci_esdhc_driver = {
373 .name = "sdhci-esdhc", 390 .name = "sdhci-esdhc",
374 .owner = THIS_MODULE, 391 .owner = THIS_MODULE,
375 .of_match_table = sdhci_esdhc_of_match, 392 .of_match_table = sdhci_esdhc_of_match,
376 .pm = SDHCI_PLTFM_PMOPS, 393 .pm = ESDHC_PMOPS,
377 }, 394 },
378 .probe = sdhci_esdhc_probe, 395 .probe = sdhci_esdhc_probe,
379 .remove = sdhci_esdhc_remove, 396 .remove = sdhci_esdhc_remove,