From: Jingoo Han <jg1.han@samsung.com>
To: "'Andrew Morton'" <akpm@linux-foundation.org>
Cc: "'LKML'" <linux-kernel@vger.kernel.org>,
"'Richard Purdie'" <rpurdie@rpsys.net>,
"'Jingoo Han'" <jg1.han@samsung.com>
Subject: [PATCH 05/14] backlight: adp8860: convert adp8860 to dev_pm_ops
Date: Tue, 12 Mar 2013 14:50:35 +0900 [thread overview]
Message-ID: <004201ce1ee5$84512ea0$8cf38be0$%han@samsung.com> (raw)
In-Reply-To: <003e01ce1ee5$4897e020$d9c7a060$%han@samsung.com>
Instead of using legacy suspend/resume methods, using newer dev_pm_ops
structure allows better control over power management.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/backlight/adp8860_bl.c | 21 ++++++++++++---------
1 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/drivers/video/backlight/adp8860_bl.c b/drivers/video/backlight/adp8860_bl.c
index a77c9ca..6bb7f36 100644
--- a/drivers/video/backlight/adp8860_bl.c
+++ b/drivers/video/backlight/adp8860_bl.c
@@ -773,25 +773,29 @@ static int adp8860_remove(struct i2c_client *client)
return 0;
}
-#ifdef CONFIG_PM
-static int adp8860_i2c_suspend(struct i2c_client *client, pm_message_t message)
+#ifdef CONFIG_PM_SLEEP
+static int adp8860_i2c_suspend(struct device *dev)
{
+ struct i2c_client *client = to_i2c_client(dev);
+
adp8860_clr_bits(client, ADP8860_MDCR, NSTBY);
return 0;
}
-static int adp8860_i2c_resume(struct i2c_client *client)
+static int adp8860_i2c_resume(struct device *dev)
{
+ struct i2c_client *client = to_i2c_client(dev);
+
adp8860_set_bits(client, ADP8860_MDCR, NSTBY | BLEN);
return 0;
}
-#else
-#define adp8860_i2c_suspend NULL
-#define adp8860_i2c_resume NULL
#endif
+static SIMPLE_DEV_PM_OPS(adp8860_i2c_pm_ops, adp8860_i2c_suspend,
+ adp8860_i2c_resume);
+
static const struct i2c_device_id adp8860_id[] = {
{ "adp8860", adp8860 },
{ "adp8861", adp8861 },
@@ -802,12 +806,11 @@ MODULE_DEVICE_TABLE(i2c, adp8860_id);
static struct i2c_driver adp8860_driver = {
.driver = {
- .name = KBUILD_MODNAME,
+ .name = KBUILD_MODNAME,
+ .pm = &adp8860_i2c_pm_ops,
},
.probe = adp8860_probe,
.remove = adp8860_remove,
- .suspend = adp8860_i2c_suspend,
- .resume = adp8860_i2c_resume,
.id_table = adp8860_id,
};
--
1.7.2.5
next prev parent reply other threads:[~2013-03-12 5:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-12 5:48 [PATCH 01/14] backlight: ld9040: convert ld9040 " Jingoo Han
2013-03-12 5:49 ` [PATCH 02/14] backlight: lms501kf03: convert lms501kf03 " Jingoo Han
2013-03-12 5:49 ` [PATCH 03/14] backlight: s6e63m0: convert s6e63m0 " Jingoo Han
2013-03-12 5:50 ` [PATCH 04/14] backlight: adp5520: convert adp5520_bl " Jingoo Han
2013-03-12 5:50 ` Jingoo Han [this message]
2013-03-12 5:50 ` [PATCH 06/14] backlight: adp8870: convert adp8870 " Jingoo Han
2013-03-12 5:51 ` [PATCH 07/14] backlight: corgi_lcd: convert corgi_lcd " Jingoo Han
2013-03-12 5:51 ` [PATCH 08/14] backlight: ep93xx: convert ep93xx " Jingoo Han
2013-03-12 5:52 ` [PATCH 09/14] backlight: hp680_bl: convert hp680bl " Jingoo Han
2013-03-12 5:52 ` [PATCH 10/14] backlight: kb3886_bl: convert kb3886bl " Jingoo Han
2013-03-12 5:52 ` [PATCH 11/14] backlight: lm3533_bl: convert lm3533_bl " Jingoo Han
2013-03-12 5:53 ` [PATCH 12/14] backlight: locomolcd: convert locomolcd " Jingoo Han
2013-03-12 5:53 ` [PATCH 13/14] backlight: ltv350qv: convert ltv350qv " Jingoo Han
2013-03-12 5:53 ` [PATCH 14/14] backlight: tdo24m: convert tdo24m " Jingoo Han
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='004201ce1ee5$84512ea0$8cf38be0$%han@samsung.com' \
--to=jg1.han@samsung.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rpurdie@rpsys.net \
/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
all inboxes | Powered by JetHome®