From: Daniel Mack <daniel@caiaq.de>
To: linux-kernel@vger.kernel.org
Cc: linux-pm@lists.linux-foundation.org,
Daniel Mack <daniel@caiaq.de>, Phil Blundell <pb@handhelds.org>,
linux-input@vger.kernel.org
Subject: [PATCH 4/5] input: gpio-keys: switch to new dev_pm_ops
Date: Wed, 5 Aug 2009 20:29:30 +0200 [thread overview]
Message-ID: <1249496971-9019-4-git-send-email-daniel@caiaq.de> (raw)
In-Reply-To: <1249496971-9019-3-git-send-email-daniel@caiaq.de>
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Phil Blundell <pb@handhelds.org>
Cc: linux-input@vger.kernel.org
---
drivers/input/keyboard/gpio_keys.c | 28 ++++++++++++++++++----------
1 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index efed0c9..bfb6fc3 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -216,12 +216,12 @@ static int __devexit gpio_keys_remove(struct platform_device *pdev)
#ifdef CONFIG_PM
-static int gpio_keys_suspend(struct platform_device *pdev, pm_message_t state)
+static int gpio_keys_suspend(struct device *dev)
{
- struct gpio_keys_platform_data *pdata = pdev->dev.platform_data;
+ struct gpio_keys_platform_data *pdata = dev->platform_data;
int i;
- if (device_may_wakeup(&pdev->dev)) {
+ if (device_may_wakeup(dev)) {
for (i = 0; i < pdata->nbuttons; i++) {
struct gpio_keys_button *button = &pdata->buttons[i];
if (button->wakeup) {
@@ -234,12 +234,12 @@ static int gpio_keys_suspend(struct platform_device *pdev, pm_message_t state)
return 0;
}
-static int gpio_keys_resume(struct platform_device *pdev)
+static int gpio_keys_resume(struct device *dev)
{
- struct gpio_keys_platform_data *pdata = pdev->dev.platform_data;
+ struct gpio_keys_platform_data *pdata = dev->platform_data;
int i;
- if (device_may_wakeup(&pdev->dev)) {
+ if (device_may_wakeup(dev)) {
for (i = 0; i < pdata->nbuttons; i++) {
struct gpio_keys_button *button = &pdata->buttons[i];
if (button->wakeup) {
@@ -251,19 +251,27 @@ static int gpio_keys_resume(struct platform_device *pdev)
return 0;
}
+
+static struct dev_pm_ops gpio_keys_pm_ops = {
+ .suspend = gpio_keys_suspend,
+ .freeze = gpio_keys_suspend,
+ .resume = gpio_keys_resume,
+ .thaw = gpio_keys_resume,
+};
+
+#define GPIO_KEYS_PM_OPS (&gpio_keys_pm_ops)
+
#else
-#define gpio_keys_suspend NULL
-#define gpio_keys_resume NULL
+#define GPIO_KEYS_PM_OPS NULL
#endif
static struct platform_driver gpio_keys_device_driver = {
.probe = gpio_keys_probe,
.remove = __devexit_p(gpio_keys_remove),
- .suspend = gpio_keys_suspend,
- .resume = gpio_keys_resume,
.driver = {
.name = "gpio-keys",
.owner = THIS_MODULE,
+ .pm = GPIO_KEYS_PM_OPS,
}
};
--
1.6.3.3
next parent reply other threads:[~2009-08-05 18:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1249496971-9019-1-git-send-email-daniel@caiaq.de>
[not found] ` <1249496971-9019-2-git-send-email-daniel@caiaq.de>
[not found] ` <1249496971-9019-3-git-send-email-daniel@caiaq.de>
2009-08-05 18:29 ` Daniel Mack [this message]
2009-08-05 20:15 ` [PATCH 4/5] input: gpio-keys: switch to new dev_pm_ops pHilipp Zabel
2009-08-05 22:33 ` Daniel Mack
2009-08-06 0:51 ` [linux-pm] " Rafael J. Wysocki
2009-08-06 12:59 ` Daniel Mack
2009-08-06 15:19 ` Rafael J. Wysocki
2009-08-07 13:39 ` pHilipp Zabel
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=1249496971-9019-4-git-send-email-daniel@caiaq.de \
--to=daniel@caiaq.de \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.linux-foundation.org \
--cc=pb@handhelds.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).