linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulf Hansson <ulf.hansson@linaro.org>
To: linux-mmc@vger.kernel.org, Chris Ball <cjb@laptop.org>,
	Guennadi Liakhovetski <g.liakhovetski@gmx.de>,
	Ian Molton <ian@mnementh.co.uk>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Subject: [PATCH 2/3] mmc: tmio_mmc: Convert from legacy to modern PM ops
Date: Tue,  5 Nov 2013 13:10:02 +0100	[thread overview]
Message-ID: <1383653403-10049-3-git-send-email-ulf.hansson@linaro.org> (raw)
In-Reply-To: <1383653403-10049-1-git-send-email-ulf.hansson@linaro.org>

Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
---
 drivers/mmc/host/tmio_mmc.c |   32 ++++++++++++++++++--------------
 1 file changed, 18 insertions(+), 14 deletions(-)

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index 8860d4d..a56a3fe 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -23,38 +23,39 @@
 
 #include "tmio_mmc.h"
 
-#ifdef CONFIG_PM
-static int tmio_mmc_suspend(struct platform_device *dev, pm_message_t state)
+#ifdef CONFIG_PM_SLEEP
+static int tmio_mmc_suspend(struct device *dev)
 {
-	const struct mfd_cell *cell = mfd_get_cell(dev);
+	struct mmc_host *mmc = dev_get_drvdata(dev);
+	struct tmio_mmc_host *host = mmc_priv(mmc);
+	const struct mfd_cell *cell = mfd_get_cell(host->pdev);
 	int ret;
 
-	ret = tmio_mmc_host_suspend(&dev->dev);
+	ret = tmio_mmc_host_suspend(dev);
 
 	/* Tell MFD core it can disable us now.*/
 	if (!ret && cell->disable)
-		cell->disable(dev);
+		cell->disable(host->pdev);
 
 	return ret;
 }
 
-static int tmio_mmc_resume(struct platform_device *dev)
+static int tmio_mmc_resume(struct device *dev)
 {
-	const struct mfd_cell *cell = mfd_get_cell(dev);
+	struct mmc_host *mmc = dev_get_drvdata(dev);
+	struct tmio_mmc_host *host = mmc_priv(mmc);
+	const struct mfd_cell *cell = mfd_get_cell(host->pdev);
 	int ret = 0;
 
 	/* Tell the MFD core we are ready to be enabled */
 	if (cell->resume)
-		ret = cell->resume(dev);
+		ret = cell->resume(host->pdev);
 
 	if (!ret)
-		ret = tmio_mmc_host_resume(&dev->dev);
+		ret = tmio_mmc_host_resume(dev);
 
 	return ret;
 }
-#else
-#define tmio_mmc_suspend NULL
-#define tmio_mmc_resume NULL
 #endif
 
 static int tmio_mmc_probe(struct platform_device *pdev)
@@ -125,15 +126,18 @@ static int tmio_mmc_remove(struct platform_device *pdev)
 
 /* ------------------- device registration ----------------------- */
 
+static const struct dev_pm_ops tmio_mmc_dev_pm_ops = {
+	SET_SYSTEM_SLEEP_PM_OPS(tmio_mmc_suspend, tmio_mmc_resume)
+};
+
 static struct platform_driver tmio_mmc_driver = {
 	.driver = {
 		.name = "tmio-mmc",
 		.owner = THIS_MODULE,
+		.pm = &tmio_mmc_dev_pm_ops,
 	},
 	.probe = tmio_mmc_probe,
 	.remove = tmio_mmc_remove,
-	.suspend = tmio_mmc_suspend,
-	.resume = tmio_mmc_resume,
 };
 
 module_platform_driver(tmio_mmc_driver);
-- 
1.7.9.5


  parent reply	other threads:[~2013-11-05 12:10 UTC|newest]

Thread overview: 181+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-05 12:10 [PATCH 0/3] mmc: tmio: Use modern PM ops Ulf Hansson
2013-11-05 12:10 ` [PATCH 1/3] mmc: sh_mobile_sdhi: Use modern PM macros to define pm callbacks Ulf Hansson
2013-11-05 22:29   ` Guennadi Liakhovetski
2013-11-05 12:10 ` Ulf Hansson [this message]
2013-11-05 22:24   ` [PATCH 2/3] mmc: tmio_mmc: Convert from legacy to modern PM ops Guennadi Liakhovetski
2013-11-05 12:10 ` [PATCH 3/3] mmc: tmio: Adapt to proper PM configs for exported functions Ulf Hansson
2013-11-05 22:29   ` Guennadi Liakhovetski
2013-11-05 13:26 ` [PATCH] mmc: trivial: fix the compiling warning Seungwon Jeon
2013-11-06  3:20   ` Jaehoon Chung
2013-11-06  9:42     ` Seungwon Jeon
2013-11-05 13:27 ` [PATCH 0/3] mmc: update bus speed mode Seungwon Jeon
2013-11-05 13:27 ` [PATCH 1/3] mmc: rework selection of " Seungwon Jeon
2013-11-05 14:06   ` Ulf Hansson
2013-11-06  9:09     ` Seungwon Jeon
2013-11-06 10:46       ` Ulf Hansson
2013-11-05 13:27 ` [PATCH 2/3] mmc: correct some exclusive card state to clear Seungwon Jeon
2013-11-05 14:33   ` Ulf Hansson
2013-11-06  9:35     ` Seungwon Jeon
2013-11-06 10:38       ` Ulf Hansson
2013-11-07  3:51         ` Seungwon Jeon
2013-11-05 13:28 ` [PATCH 3/3] mmc: add support for hs400 mode of eMMC5.0 Seungwon Jeon
2013-11-07  7:38   ` Shen, Jackey
2013-11-07 11:38     ` Seungwon Jeon
2013-11-08  9:05       ` Jackey Shen
2013-11-11 12:51         ` Seungwon Jeon
2013-11-25  7:32           ` Jackey Shen
2013-11-08 12:16 ` [PATCH 0/3] mmc: tmio: Use modern PM ops Guennadi Liakhovetski
2013-11-11  9:24   ` Ulf Hansson
2014-01-15 14:10 ` [PATCH 0/7] mmc: distinguish DDR timing mode for eMMC/UHS Seungwon Jeon
2014-01-15 14:10 ` [PATCH 1/7] mmc: clarify DDR timing mode between SD-UHS and eMMC Seungwon Jeon
2014-01-16 10:50   ` Ulf Hansson
2014-01-17 21:22     ` Ulf Hansson
2014-01-20  3:55       ` Seungwon Jeon
2014-01-23  9:06         ` Ulf Hansson
2014-01-15 14:11 ` [PATCH 2/7] mmc: mmci: " Seungwon Jeon
2014-01-16 10:20   ` Ulf Hansson
2014-01-17 14:05     ` Seungwon Jeon
2014-01-17 14:50     ` [PATCH v2 " Seungwon Jeon
2014-01-15 14:11 ` [PATCH 3/7] mmc: omap: " Seungwon Jeon
2014-01-16 10:49   ` Ulf Hansson
2014-01-16 11:07     ` Balaji T K
2014-01-16 11:01   ` Balaji T K
2014-01-15 14:12 ` [PATCH 4/7] mmc: sh_mmcif: " Seungwon Jeon
2014-01-16 10:22   ` Ulf Hansson
2014-01-17 14:36     ` Seungwon Jeon
2014-01-28 13:08     ` Seungwon Jeon
2014-01-15 14:12 ` [PATCH 5/7] mmc: rtsx: " Seungwon Jeon
2014-01-16 10:51   ` Ulf Hansson
2014-01-15 14:12 ` [PATCH 6/7] mmc: dw_mmc: " Seungwon Jeon
2014-01-16 10:37   ` Ulf Hansson
2014-01-15 14:12 ` [PATCH 7/7] mmc: sdhci: " Seungwon Jeon
2014-01-16 10:25   ` Ulf Hansson
2014-01-15 14:13 ` [PATCH 0/5] update selection of bus speed mode for eMMC Seungwon Jeon
2014-01-15 14:14 ` [PATCH 1/5] mmc: drop the speed mode of card's state Seungwon Jeon
2014-01-15 14:14 ` [PATCH 2/5] mmc: identify available device type to select Seungwon Jeon
2014-01-15 14:14 ` [PATCH 3/5] mmc: step power class after final selection of bus mode Seungwon Jeon
2014-01-15 14:15 ` [PATCH 4/5] mmc: rework selection of bus speed mode Seungwon Jeon
2014-01-15 14:19 ` [PATCH 5/5] mmc: add support for HS400 mode of eMMC5.0 Seungwon Jeon
2014-02-18 10:24   ` Jackey Shen
2014-02-18 13:31     ` Seungwon Jeon
2014-02-15 14:08 ` [PATCH v2 0/7] mmc: distinguish DDR timing mode for eMMC/UHS Seungwon Jeon
2014-03-07 13:30   ` [PATCH v3 " Seungwon Jeon
2014-03-14 12:11   ` [PATCH RESEND " Seungwon Jeon
2014-04-02 11:50     ` Ulf Hansson
2014-04-03 11:56       ` Seungwon Jeon
2014-02-15 14:08 ` [PATCH v2 1/7] mmc: clarify DDR timing mode between SD-UHS and eMMC Seungwon Jeon
2014-03-07 13:30   ` [PATCH v3 " Seungwon Jeon
2014-03-07 13:42     ` Jaehoon Chung
2014-03-14 12:11   ` [PATCH RESEND " Seungwon Jeon
2014-02-15 14:08 ` [PATCH v2 2/7] mmc: mmci: " Seungwon Jeon
2014-02-17 14:08   ` Ulf Hansson
2014-02-18 13:34     ` Seungwon Jeon
2014-03-07 13:30   ` [PATCH v3 " Seungwon Jeon
2014-03-14 12:12   ` [PATCH RESEND " Seungwon Jeon
2014-02-15 14:09 ` [PATCH v2 3/7] mmc: omap: " Seungwon Jeon
2014-03-07 13:30   ` [PATCH v3 " Seungwon Jeon
2014-03-14 12:12   ` [PATCH RESEND " Seungwon Jeon
2014-02-15 14:09 ` [PATCH v2 4/7] mmc: sh_mmcif: " Seungwon Jeon
2014-03-07 13:30   ` [PATCH v3 " Seungwon Jeon
2014-03-14 12:12   ` [PATCH RESEND " Seungwon Jeon
2014-02-15 14:09 ` [PATCH v2 5/7] mmc: rtsx: " Seungwon Jeon
2014-03-07 13:31   ` [PATCH v3 " Seungwon Jeon
2014-03-14 12:12   ` [PATCH RESEND " Seungwon Jeon
2014-02-15 14:09 ` [PATCH v2 6/7] mmc: dw_mmc: " Seungwon Jeon
2014-03-07 13:31   ` [PATCH v3 " Seungwon Jeon
2014-03-07 13:43     ` Jaehoon Chung
2014-03-14 12:12   ` [PATCH RESEMD " Seungwon Jeon
2014-02-15 14:09 ` [PATCH v2 7/7] mmc: sdhci: " Seungwon Jeon
2014-03-07 13:31   ` [PATCH v3 " Seungwon Jeon
2014-03-14 12:12   ` [PATCH RESEND " Seungwon Jeon
2014-02-15 14:18 ` [PATCH RESEND 0/5] update selection of bus speed mode for eMMC Seungwon Jeon
2014-03-07 14:35   ` [PATCH v2 " Seungwon Jeon
2014-03-13 14:41     ` Ulf Hansson
2014-03-13  9:52   ` [PATCH RESEND " Jaehoon Chung
2014-03-14 12:16   ` [PATCH v3 " Seungwon Jeon
2014-03-17  8:47     ` Ulf Hansson
2014-03-18  1:43       ` Seungwon Jeon
2014-03-18  4:20         ` Jaehoon Chung
2014-03-18  8:01           ` Ulf Hansson
2014-03-26 10:59   ` [PATCH v4 " Seungwon Jeon
2014-03-26 11:00   ` [PATCH v4 1/5] mmc: drop the speed mode of card's state Seungwon Jeon
2014-03-26 11:00   ` [PATCH v4 2/5] mmc: identify available device type to select Seungwon Jeon
2014-03-26 11:00   ` [PATCH v4 3/5] mmc: step power class after final selection of bus mode Seungwon Jeon
2014-03-28  8:43     ` Ulf Hansson
2014-03-26 11:00   ` [PATCH v4 4/5] mmc: rework selection of bus speed mode Seungwon Jeon
2014-03-26 11:00   ` [PATCH v4 5/5] mmc: add support for HS400 mode of eMMC5.0 Seungwon Jeon
2014-04-11 11:33   ` [PATCH v5 0/5] update selection of bus speed mode for eMMC Seungwon Jeon
2014-04-11 11:34   ` [PATCH v5 1/5] mmc: drop the speed mode of card's state Seungwon Jeon
2014-04-11 11:34   ` [PATCH v5 2/5] mmc: identify available device type to select Seungwon Jeon
2014-04-11 11:47     ` Ulf Hansson
2014-04-11 11:34   ` [PATCH v5 3/5] mmc: step power class after final selection of bus mode Seungwon Jeon
2014-04-11 11:34   ` [PATCH v5 4/5] mmc: rework selection of bus speed mode Seungwon Jeon
2014-04-11 11:34   ` [PATCH v5 5/5] mmc: add support for HS400 mode of eMMC5.0 Seungwon Jeon
2014-04-11 12:06     ` Ulf Hansson
2014-04-18 13:36   ` [PATCH v6 0/6] update selection of bus speed mode for eMMC Seungwon Jeon
2014-04-20  7:18     ` Ulf Hansson
2014-04-21  3:55       ` Seungwon Jeon
2014-04-18 13:36   ` [PATCH v6 1/6] mmc: drop the speed mode of card's state Seungwon Jeon
2014-04-18 13:36   ` [PATCH v6 2/6] mmc: identify available device type to select Seungwon Jeon
2014-04-18 13:36   ` [PATCH v6 3/6] mmc: step power class after final selection of bus mode Seungwon Jeon
2014-04-18 13:36   ` [PATCH v6 4/6] mmc: rework selection of bus speed mode Seungwon Jeon
2014-04-18 13:37   ` [PATCH v6 5/6] mmc: add support for HS400 mode of eMMC5.0 Seungwon Jeon
2014-04-18 13:37   ` [PATCH v6 6/6] mmc: core: add DT bindings for eMMC HS400 1.8/1.2V Seungwon Jeon
2014-04-23  8:30     ` Ulf Hansson
2014-04-23  8:07   ` [PATCH 0/6] update selection of bus speed mode for eMMC Seungwon Jeon
2014-04-23  8:07   ` [PATCH 1/6] mmc: drop the speed mode of card's state Seungwon Jeon
2014-05-05  8:02     ` Ulf Hansson
2014-04-23  8:07   ` [PATCH 2/6] mmc: identify available device type to select Seungwon Jeon
2014-04-23  8:08   ` [PATCH 3/6] mmc: step power class after final selection of bus mode Seungwon Jeon
2014-04-23  8:08   ` [PATCH 4/6] mmc: rework selection of bus speed mode Seungwon Jeon
2014-04-23  8:14   ` [PATCH 5/6] mmc: add support for HS400 mode of eMMC5.0 Seungwon Jeon
2014-04-23  8:15   ` [PATCH 6/6] mmc: core: add DT bindings for eMMC HS400 1.8/1.2V Seungwon Jeon
2014-02-15 14:18 ` [PATCH RESEND 1/5] mmc: drop the speed mode of card's state Seungwon Jeon
2014-02-17 14:38   ` Ulf Hansson
2014-02-18 13:43     ` Seungwon Jeon
2014-02-18 16:40       ` Ulf Hansson
2014-03-07 14:36   ` [PATCH v2 " Seungwon Jeon
2014-03-14 12:16   ` [PATCH v3 " Seungwon Jeon
2014-02-15 14:18 ` [PATCH RESEND 2/5] mmc: identify available device type to select Seungwon Jeon
2014-03-07 14:36   ` [PATCH v2 " Seungwon Jeon
2014-03-10 10:14     ` Jaehoon Chung
2014-03-10 11:59       ` Seungwon Jeon
2014-03-13  5:37         ` Jaehoon Chung
2014-03-13  8:37           ` Seungwon Jeon
2014-03-13  9:51             ` Jaehoon Chung
2014-03-13 14:02     ` Ulf Hansson
2014-03-14  2:49       ` Seungwon Jeon
2014-03-14  7:34         ` Ulf Hansson
2014-03-14 10:24           ` Seungwon Jeon
2014-03-28  8:31         ` Ulf Hansson
2014-03-28 12:27           ` Seungwon Jeon
2014-03-14 12:16   ` [PATCH v3 " Seungwon Jeon
2014-02-15 14:23 ` [PATCH RESEND 3/5] mmc: step power class after final selection of bus mode Seungwon Jeon
2014-03-07 14:36   ` [PATCH v2 " Seungwon Jeon
2014-03-13 14:28     ` Ulf Hansson
2014-03-14  2:49       ` Seungwon Jeon
2014-03-14  7:31         ` Ulf Hansson
2014-03-14 12:16   ` [PATCH v3 " Seungwon Jeon
2014-02-15 14:24 ` [PATCH RESEND 4/5] mmc: rework selection of bus speed mode Seungwon Jeon
2014-03-07 14:36   ` [PATCH v2 " Seungwon Jeon
2014-03-14 12:16   ` [PATCH v3 " Seungwon Jeon
2014-03-21 13:01     ` Ulf Hansson
2014-03-22 12:04       ` Seungwon Jeon
2014-03-24 13:11         ` Ulf Hansson
2014-02-15 14:24 ` [PATCH RESEND 5/5] mmc: add support for HS400 mode of eMMC5.0 Seungwon Jeon
2014-03-07 14:36   ` [PATCH v2 " Seungwon Jeon
2014-03-11  0:45     ` Jackey Shen
2014-03-14 11:34       ` Seungwon Jeon
2014-03-14 12:16   ` [PATCH v3 " Seungwon Jeon
2014-03-24 15:41     ` Ulf Hansson
2014-03-25  9:23       ` Seungwon Jeon
2014-03-28  9:57         ` Ulf Hansson
2014-03-28 12:18           ` Seungwon Jeon
2014-03-28 13:33             ` Ulf Hansson
2014-04-02  1:15               ` Seungwon Jeon
2014-04-02  9:39                 ` Ulf Hansson
2014-04-03 11:53                   ` Seungwon Jeon
2014-04-03 13:14                     ` Ulf Hansson
2014-04-04 10:46                       ` Seungwon Jeon
2014-04-04 11:58                         ` Ulf Hansson
2014-04-05 14:36                           ` Seungwon Jeon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1383653403-10049-3-git-send-email-ulf.hansson@linaro.org \
    --to=ulf.hansson@linaro.org \
    --cc=cjb@laptop.org \
    --cc=g.liakhovetski@gmx.de \
    --cc=ian@mnementh.co.uk \
    --cc=linux-mmc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).