diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-17 15:58:07 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-17 15:58:07 -0800 |
commit | 4e46aa083853a84c770e00b03746bdeaf5c5aeff (patch) | |
tree | f93d3f88e038d176a4661639edbdb9a99d9f7402 /drivers/video/backlight/pwm_bl.c | |
parent | 9209e4bd4b3b9ee3a104313b426380e8d1f59260 (diff) | |
parent | f7a297af49e5d9d2c577466307e8ef392750c9d9 (diff) | |
download | lwn-4e46aa083853a84c770e00b03746bdeaf5c5aeff.tar.gz lwn-4e46aa083853a84c770e00b03746bdeaf5c5aeff.zip |
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight:
backlight: mbp_nvidia_bl - add two more MacBookPro variants
backlight: Pass device through notify callback in the pwm driver
backlight: PTR_ERR return of wrong pointer in cr_backlight_probe()
backlight: Constify struct backlight_ops
backlight/thinkpad-acpi: issue backlight class events
Fix up trivial conflicts in thinkpad-acpi support (backlight support
already merged earlier).
Diffstat (limited to 'drivers/video/backlight/pwm_bl.c')
-rw-r--r-- | drivers/video/backlight/pwm_bl.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 887166267443..9d2ec2a1cce8 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c @@ -22,8 +22,10 @@ struct pwm_bl_data { struct pwm_device *pwm; + struct device *dev; unsigned int period; - int (*notify)(int brightness); + int (*notify)(struct device *, + int brightness); }; static int pwm_backlight_update_status(struct backlight_device *bl) @@ -39,7 +41,7 @@ static int pwm_backlight_update_status(struct backlight_device *bl) brightness = 0; if (pb->notify) - brightness = pb->notify(brightness); + brightness = pb->notify(pb->dev, brightness); if (brightness == 0) { pwm_config(pb->pwm, 0, pb->period); @@ -56,7 +58,7 @@ static int pwm_backlight_get_brightness(struct backlight_device *bl) return bl->props.brightness; } -static struct backlight_ops pwm_backlight_ops = { +static const struct backlight_ops pwm_backlight_ops = { .update_status = pwm_backlight_update_status, .get_brightness = pwm_backlight_get_brightness, }; @@ -88,6 +90,7 @@ static int pwm_backlight_probe(struct platform_device *pdev) pb->period = data->pwm_period_ns; pb->notify = data->notify; + pb->dev = &pdev->dev; pb->pwm = pwm_request(data->pwm_id, "backlight"); if (IS_ERR(pb->pwm)) { @@ -146,7 +149,7 @@ static int pwm_backlight_suspend(struct platform_device *pdev, struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); if (pb->notify) - pb->notify(0); + pb->notify(pb->dev, 0); pwm_config(pb->pwm, 0, pb->period); pwm_disable(pb->pwm); return 0; |