From: "Eric Bénard" <eric@eukrea.com>
Cc: s.hauer@pengutronix.de, linux-mmc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mxcmmc: convert to pm_ops and enable/disable clock
Date: Thu, 17 Jun 2010 20:59:07 +0200 [thread overview]
Message-ID: <1276801147-4103-7-git-send-email-eric@eukrea.com> (raw)
In-Reply-To: <1276801147-4103-6-git-send-email-eric@eukrea.com>
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
---
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 fdf33e8..350f78e 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)
}
#ifdef CONFIG_PM
-static int mxcmci_suspend(struct platform_device *dev, pm_message_t state)
+static int mxcmci_suspend(struct device *dev)
{
- struct mmc_host *mmc = platform_get_drvdata(dev);
+ struct mmc_host *mmc = dev_get_drvdata(dev);
+ struct mxcmci_host *host = mmc_priv(mmc);
int ret = 0;
if (mmc)
ret = mmc_suspend_host(mmc);
+ clk_disable(host->clk);
return ret;
}
-static int mxcmci_resume(struct platform_device *dev)
+static int mxcmci_resume(struct device *dev)
{
- struct mmc_host *mmc = platform_get_drvdata(dev);
- struct mxcmci_host *host;
+ struct mmc_host *mmc = dev_get_drvdata(dev);
+ struct mxcmci_host *host = mmc_priv(mmc);
int ret = 0;
- if (mmc) {
- host = mmc_priv(mmc);
+ clk_enable(host->clk);
+ if (mmc)
ret = mmc_resume_host(mmc);
- }
return ret;
}
-#else
-#define mxcmci_suspend NULL
-#define mxcmci_resume NULL
-#endif /* CONFIG_PM */
+
+static const struct dev_pm_ops mxcmci_pm_ops = {
+ .suspend = mxcmci_suspend,
+ .resume = mxcmci_resume,
+};
+#endif
static struct platform_driver mxcmci_driver = {
.probe = mxcmci_probe,
.remove = mxcmci_remove,
- .suspend = mxcmci_suspend,
- .resume = mxcmci_resume,
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
+#ifdef CONFIG_PM
+ .pm = &mxcmci_pm_ops,
+#endif
}
};
--
1.6.3.3
WARNING: multiple messages have this Message-ID (diff)
From: eric@eukrea.com (Eric Bénard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mxcmmc: convert to pm_ops and enable/disable clock
Date: Thu, 17 Jun 2010 20:59:07 +0200 [thread overview]
Message-ID: <1276801147-4103-7-git-send-email-eric@eukrea.com> (raw)
In-Reply-To: <1276801147-4103-6-git-send-email-eric@eukrea.com>
Signed-off-by: Eric B?nard <eric@eukrea.com>
Cc: s.hauer at pengutronix.de
Cc: linux-mmc at vger.kernel.org
Cc: linux-arm-kernel at lists.infradead.org
---
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 fdf33e8..350f78e 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)
}
#ifdef CONFIG_PM
-static int mxcmci_suspend(struct platform_device *dev, pm_message_t state)
+static int mxcmci_suspend(struct device *dev)
{
- struct mmc_host *mmc = platform_get_drvdata(dev);
+ struct mmc_host *mmc = dev_get_drvdata(dev);
+ struct mxcmci_host *host = mmc_priv(mmc);
int ret = 0;
if (mmc)
ret = mmc_suspend_host(mmc);
+ clk_disable(host->clk);
return ret;
}
-static int mxcmci_resume(struct platform_device *dev)
+static int mxcmci_resume(struct device *dev)
{
- struct mmc_host *mmc = platform_get_drvdata(dev);
- struct mxcmci_host *host;
+ struct mmc_host *mmc = dev_get_drvdata(dev);
+ struct mxcmci_host *host = mmc_priv(mmc);
int ret = 0;
- if (mmc) {
- host = mmc_priv(mmc);
+ clk_enable(host->clk);
+ if (mmc)
ret = mmc_resume_host(mmc);
- }
return ret;
}
-#else
-#define mxcmci_suspend NULL
-#define mxcmci_resume NULL
-#endif /* CONFIG_PM */
+
+static const struct dev_pm_ops mxcmci_pm_ops = {
+ .suspend = mxcmci_suspend,
+ .resume = mxcmci_resume,
+};
+#endif
static struct platform_driver mxcmci_driver = {
.probe = mxcmci_probe,
.remove = mxcmci_remove,
- .suspend = mxcmci_suspend,
- .resume = mxcmci_resume,
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
+#ifdef CONFIG_PM
+ .pm = &mxcmci_pm_ops,
+#endif
}
};
--
1.6.3.3
next prev parent reply other threads:[~2010-06-17 18:59 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-17 18:59 [PATCH v2] input/imx_keypad: add PM support Eric Bénard
2010-06-17 18:59 ` Eric Bénard
2010-06-17 18:59 ` [PATCH] eukrea_mbimx27: update keyboard platform data Eric Bénard
2010-06-17 18:59 ` [PATCH] eukrea_mbimx27-baseboard: fix compile when CONFIG_SPI_IMX is disabled Eric Bénard
2010-06-17 18:59 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Eric Bénard
2010-06-17 18:59 ` Eric Bénard
2010-06-17 18:59 ` [PATCH] video/imxfb: fix suspend when screen is blanked Eric Bénard
2010-06-17 18:59 ` Eric Bénard
2010-06-17 18:59 ` [PATCH] mach-mx3/mach-mx31_3ds: update keypad registration Eric Bénard
2010-06-17 18:59 ` Eric Bénard [this message]
2010-06-17 18:59 ` [PATCH] mxcmmc: convert to pm_ops and enable/disable clock Eric Bénard
2010-06-17 19:22 ` [PATCH] video/imxfb: fix suspend when screen is blanked Luotao Fu
2010-06-17 19:22 ` Luotao Fu
2010-06-18 6:30 ` Eric Bénard
2010-06-18 6:30 ` Eric Bénard
2010-07-07 14:17 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Artem Bityutskiy
2010-07-07 14:17 ` Artem Bityutskiy
2010-07-17 7:24 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend, resume} explicitly Eric Bénard
2010-07-17 7:24 ` Eric Bénard
2010-07-17 7:33 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Artem Bityutskiy
2010-07-17 7:33 ` Artem Bityutskiy
2010-07-17 12:49 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend, resume} explicitly Eric Bénard
2010-07-17 12:49 ` Eric Bénard
2010-07-17 15:13 ` [PATCH v2] mtd/mxc_nand: don't call mtd->{suspend,resume} explicitly Artem Bityutskiy
2010-07-17 15:13 ` Artem Bityutskiy
2010-06-18 10:16 ` [PATCH v2] input/imx_keypad: add PM support Alberto Panizzo
2010-06-18 10:16 ` Alberto Panizzo
2010-06-18 14:37 ` Eric Bénard
2010-06-18 14:37 ` Eric Bénard
2010-06-18 17:40 ` Alberto Panizzo
2010-06-18 17:40 ` Alberto Panizzo
2010-06-18 17:50 ` Eric Bénard
2010-06-18 17:50 ` Eric Bénard
2010-06-24 16:39 ` Dmitry Torokhov
2010-06-24 16:39 ` Dmitry Torokhov
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=1276801147-4103-7-git-send-email-eric@eukrea.com \
--to=eric@eukrea.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=s.hauer@pengutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.