summaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight/adp8870_bl.c
diff options
context:
space:
mode:
authorJingoo Han <jg1.han@samsung.com>2013-04-30 01:17:40 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 03:28:16 +0200
commit3cd4291aaf4b098d2591a72570a499d1fc9e7e53 (patch)
treebfd1c664b419953674a28e725146b53d76a48104 /drivers/video/backlight/adp8870_bl.c
parentbacklight: adp8860: convert adp8860 to dev_pm_ops (diff)
downloadlinux-3cd4291aaf4b098d2591a72570a499d1fc9e7e53.tar.xz
linux-3cd4291aaf4b098d2591a72570a499d1fc9e7e53.zip
backlight: adp8870: convert adp8870 to dev_pm_ops
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> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/backlight/adp8870_bl.c')
-rw-r--r--drivers/video/backlight/adp8870_bl.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/video/backlight/adp8870_bl.c b/drivers/video/backlight/adp8870_bl.c
index 7930ab3ff4de..302c8009a7dc 100644
--- a/drivers/video/backlight/adp8870_bl.c
+++ b/drivers/video/backlight/adp8870_bl.c
@@ -947,25 +947,29 @@ static int adp8870_remove(struct i2c_client *client)
return 0;
}
-#ifdef CONFIG_PM
-static int adp8870_i2c_suspend(struct i2c_client *client, pm_message_t message)
+#ifdef CONFIG_PM_SLEEP
+static int adp8870_i2c_suspend(struct device *dev)
{
+ struct i2c_client *client = to_i2c_client(dev);
+
adp8870_clr_bits(client, ADP8870_MDCR, NSTBY);
return 0;
}
-static int adp8870_i2c_resume(struct i2c_client *client)
+static int adp8870_i2c_resume(struct device *dev)
{
+ struct i2c_client *client = to_i2c_client(dev);
+
adp8870_set_bits(client, ADP8870_MDCR, NSTBY | BLEN);
return 0;
}
-#else
-#define adp8870_i2c_suspend NULL
-#define adp8870_i2c_resume NULL
#endif
+static SIMPLE_DEV_PM_OPS(adp8870_i2c_pm_ops, adp8870_i2c_suspend,
+ adp8870_i2c_resume);
+
static const struct i2c_device_id adp8870_id[] = {
{ "adp8870", 0 },
{ }
@@ -974,12 +978,11 @@ MODULE_DEVICE_TABLE(i2c, adp8870_id);
static struct i2c_driver adp8870_driver = {
.driver = {
- .name = KBUILD_MODNAME,
+ .name = KBUILD_MODNAME,
+ .pm = &adp8870_i2c_pm_ops,
},
.probe = adp8870_probe,
.remove = adp8870_remove,
- .suspend = adp8870_i2c_suspend,
- .resume = adp8870_i2c_resume,
.id_table = adp8870_id,
};