diff options
| author | Jingoo Han <jg1.han@samsung.com> | 2013-04-29 19:17:40 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-04-29 21:28:16 -0400 |
| commit | 3cd4291aaf4b098d2591a72570a499d1fc9e7e53 (patch) | |
| tree | bfd1c664b419953674a28e725146b53d76a48104 /drivers/video/backlight | |
| parent | cf108b5c98e1e7d88ba54667356c4d7a077a75e2 (diff) | |
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')
| -rw-r--r-- | drivers/video/backlight/adp8870_bl.c | 21 |
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) | |||
| 947 | return 0; | 947 | return 0; |
| 948 | } | 948 | } |
| 949 | 949 | ||
| 950 | #ifdef CONFIG_PM | 950 | #ifdef CONFIG_PM_SLEEP |
| 951 | static int adp8870_i2c_suspend(struct i2c_client *client, pm_message_t message) | 951 | static int adp8870_i2c_suspend(struct device *dev) |
| 952 | { | 952 | { |
| 953 | struct i2c_client *client = to_i2c_client(dev); | ||
| 954 | |||
| 953 | adp8870_clr_bits(client, ADP8870_MDCR, NSTBY); | 955 | adp8870_clr_bits(client, ADP8870_MDCR, NSTBY); |
| 954 | 956 | ||
| 955 | return 0; | 957 | return 0; |
| 956 | } | 958 | } |
| 957 | 959 | ||
| 958 | static int adp8870_i2c_resume(struct i2c_client *client) | 960 | static int adp8870_i2c_resume(struct device *dev) |
| 959 | { | 961 | { |
| 962 | struct i2c_client *client = to_i2c_client(dev); | ||
| 963 | |||
| 960 | adp8870_set_bits(client, ADP8870_MDCR, NSTBY | BLEN); | 964 | adp8870_set_bits(client, ADP8870_MDCR, NSTBY | BLEN); |
| 961 | 965 | ||
| 962 | return 0; | 966 | return 0; |
| 963 | } | 967 | } |
| 964 | #else | ||
| 965 | #define adp8870_i2c_suspend NULL | ||
| 966 | #define adp8870_i2c_resume NULL | ||
| 967 | #endif | 968 | #endif |
| 968 | 969 | ||
| 970 | static SIMPLE_DEV_PM_OPS(adp8870_i2c_pm_ops, adp8870_i2c_suspend, | ||
| 971 | adp8870_i2c_resume); | ||
| 972 | |||
| 969 | static const struct i2c_device_id adp8870_id[] = { | 973 | static const struct i2c_device_id adp8870_id[] = { |
| 970 | { "adp8870", 0 }, | 974 | { "adp8870", 0 }, |
| 971 | { } | 975 | { } |
| @@ -974,12 +978,11 @@ MODULE_DEVICE_TABLE(i2c, adp8870_id); | |||
| 974 | 978 | ||
| 975 | static struct i2c_driver adp8870_driver = { | 979 | static struct i2c_driver adp8870_driver = { |
| 976 | .driver = { | 980 | .driver = { |
| 977 | .name = KBUILD_MODNAME, | 981 | .name = KBUILD_MODNAME, |
| 982 | .pm = &adp8870_i2c_pm_ops, | ||
| 978 | }, | 983 | }, |
| 979 | .probe = adp8870_probe, | 984 | .probe = adp8870_probe, |
| 980 | .remove = adp8870_remove, | 985 | .remove = adp8870_remove, |
| 981 | .suspend = adp8870_i2c_suspend, | ||
| 982 | .resume = adp8870_i2c_resume, | ||
| 983 | .id_table = adp8870_id, | 986 | .id_table = adp8870_id, |
| 984 | }; | 987 | }; |
| 985 | 988 | ||
