diff options
author | Dilan Lee <dilee@nvidia.com> | 2011-08-25 18:59:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-08-25 19:25:34 -0400 |
commit | cc7993f6439b49909a8792660c4d0741fec9d584 (patch) | |
tree | 036093bfb2d5606c05fda6e08a433867e138ee21 /drivers/video/backlight | |
parent | 23751be0094012eb6b4756fa80ca54b3eb83069f (diff) |
backlight: add a callback 'notify_after' for backlight control
We need a callback to do some things after pwm_enable, pwm_disable
and pwm_config.
Signed-off-by: Dilan Lee <dilee@nvidia.com>
Reviewed-by: Robert Morell <rmorell@nvidia.com>
Reviewed-by: Arun Murthy <arun.murthy@stericsson.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Paul Mundt <lethal@linux-sh.org>
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/pwm_bl.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index b8f38ec6eb18..8b5b2a4124c7 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c | |||
@@ -28,6 +28,8 @@ struct pwm_bl_data { | |||
28 | unsigned int lth_brightness; | 28 | unsigned int lth_brightness; |
29 | int (*notify)(struct device *, | 29 | int (*notify)(struct device *, |
30 | int brightness); | 30 | int brightness); |
31 | void (*notify_after)(struct device *, | ||
32 | int brightness); | ||
31 | int (*check_fb)(struct device *, struct fb_info *); | 33 | int (*check_fb)(struct device *, struct fb_info *); |
32 | }; | 34 | }; |
33 | 35 | ||
@@ -55,6 +57,10 @@ static int pwm_backlight_update_status(struct backlight_device *bl) | |||
55 | pwm_config(pb->pwm, brightness, pb->period); | 57 | pwm_config(pb->pwm, brightness, pb->period); |
56 | pwm_enable(pb->pwm); | 58 | pwm_enable(pb->pwm); |
57 | } | 59 | } |
60 | |||
61 | if (pb->notify_after) | ||
62 | pb->notify_after(pb->dev, brightness); | ||
63 | |||
58 | return 0; | 64 | return 0; |
59 | } | 65 | } |
60 | 66 | ||
@@ -105,6 +111,7 @@ static int pwm_backlight_probe(struct platform_device *pdev) | |||
105 | 111 | ||
106 | pb->period = data->pwm_period_ns; | 112 | pb->period = data->pwm_period_ns; |
107 | pb->notify = data->notify; | 113 | pb->notify = data->notify; |
114 | pb->notify_after = data->notify_after; | ||
108 | pb->check_fb = data->check_fb; | 115 | pb->check_fb = data->check_fb; |
109 | pb->lth_brightness = data->lth_brightness * | 116 | pb->lth_brightness = data->lth_brightness * |
110 | (data->pwm_period_ns / data->max_brightness); | 117 | (data->pwm_period_ns / data->max_brightness); |
@@ -172,6 +179,8 @@ static int pwm_backlight_suspend(struct platform_device *pdev, | |||
172 | pb->notify(pb->dev, 0); | 179 | pb->notify(pb->dev, 0); |
173 | pwm_config(pb->pwm, 0, pb->period); | 180 | pwm_config(pb->pwm, 0, pb->period); |
174 | pwm_disable(pb->pwm); | 181 | pwm_disable(pb->pwm); |
182 | if (pb->notify_after) | ||
183 | pb->notify_after(pb->dev, 0); | ||
175 | return 0; | 184 | return 0; |
176 | } | 185 | } |
177 | 186 | ||