提交 cfc3899f 编写于 作者: B Ben Dooks 提交者: Richard Purdie

backlight: Pass device through notify callback in the pwm driver

Add the device to the notify callback's arguments in the PWM backlight 
driver. This brings the notify callback into line with the other 
callbacks defined by this driver.
Signed-off-by: NBen Dooks <ben@simtec.co.uk>
Signed-off-by: NSimtec Linux Team <linux@simtec.co.uk>
Signed-off-by: NRichard Purdie <rpurdie@linux.intel.com>
上级 5b0582ea
......@@ -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);
......@@ -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;
......
......@@ -10,7 +10,7 @@ struct platform_pwm_backlight_data {
unsigned int dft_brightness;
unsigned int pwm_period_ns;
int (*init)(struct device *dev);
int (*notify)(int brightness);
int (*notify)(struct device *dev, int brightness);
void (*exit)(struct device *dev);
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册