diff options
| -rw-r--r-- | drivers/video/backlight/pwm_bl.c | 9 | ||||
| -rw-r--r-- | include/linux/pwm_backlight.h | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index df9e0b32cf39..9d2ec2a1cce8 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c | |||
| @@ -22,8 +22,10 @@ | |||
| 22 | 22 | ||
| 23 | struct pwm_bl_data { | 23 | struct pwm_bl_data { |
| 24 | struct pwm_device *pwm; | 24 | struct pwm_device *pwm; |
| 25 | struct device *dev; | ||
| 25 | unsigned int period; | 26 | unsigned int period; |
| 26 | int (*notify)(int brightness); | 27 | int (*notify)(struct device *, |
| 28 | int brightness); | ||
| 27 | }; | 29 | }; |
| 28 | 30 | ||
| 29 | static int pwm_backlight_update_status(struct backlight_device *bl) | 31 | static int pwm_backlight_update_status(struct backlight_device *bl) |
| @@ -39,7 +41,7 @@ static int pwm_backlight_update_status(struct backlight_device *bl) | |||
| 39 | brightness = 0; | 41 | brightness = 0; |
| 40 | 42 | ||
| 41 | if (pb->notify) | 43 | if (pb->notify) |
| 42 | brightness = pb->notify(brightness); | 44 | brightness = pb->notify(pb->dev, brightness); |
| 43 | 45 | ||
| 44 | if (brightness == 0) { | 46 | if (brightness == 0) { |
| 45 | pwm_config(pb->pwm, 0, pb->period); | 47 | pwm_config(pb->pwm, 0, pb->period); |
| @@ -88,6 +90,7 @@ static int pwm_backlight_probe(struct platform_device *pdev) | |||
| 88 | 90 | ||
| 89 | pb->period = data->pwm_period_ns; | 91 | pb->period = data->pwm_period_ns; |
| 90 | pb->notify = data->notify; | 92 | pb->notify = data->notify; |
| 93 | pb->dev = &pdev->dev; | ||
| 91 | 94 | ||
| 92 | pb->pwm = pwm_request(data->pwm_id, "backlight"); | 95 | pb->pwm = pwm_request(data->pwm_id, "backlight"); |
| 93 | if (IS_ERR(pb->pwm)) { | 96 | if (IS_ERR(pb->pwm)) { |
| @@ -146,7 +149,7 @@ static int pwm_backlight_suspend(struct platform_device *pdev, | |||
| 146 | struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); | 149 | struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); |
| 147 | 150 | ||
| 148 | if (pb->notify) | 151 | if (pb->notify) |
| 149 | pb->notify(0); | 152 | pb->notify(pb->dev, 0); |
| 150 | pwm_config(pb->pwm, 0, pb->period); | 153 | pwm_config(pb->pwm, 0, pb->period); |
| 151 | pwm_disable(pb->pwm); | 154 | pwm_disable(pb->pwm); |
| 152 | return 0; | 155 | return 0; |
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h index 7a9754c96775..01b3d759f1fc 100644 --- a/include/linux/pwm_backlight.h +++ b/include/linux/pwm_backlight.h | |||
| @@ -10,7 +10,7 @@ struct platform_pwm_backlight_data { | |||
| 10 | unsigned int dft_brightness; | 10 | unsigned int dft_brightness; |
| 11 | unsigned int pwm_period_ns; | 11 | unsigned int pwm_period_ns; |
| 12 | int (*init)(struct device *dev); | 12 | int (*init)(struct device *dev); |
| 13 | int (*notify)(int brightness); | 13 | int (*notify)(struct device *dev, int brightness); |
| 14 | void (*exit)(struct device *dev); | 14 | void (*exit)(struct device *dev); |
| 15 | }; | 15 | }; |
| 16 | 16 | ||
