Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263340
b: refs/heads/master
c: cc7993f
h: refs/heads/master
v: v3
  • Loading branch information
Dilan Lee authored and Linus Torvalds committed Aug 25, 2011
1 parent d1af67a commit 344522b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 23751be0094012eb6b4756fa80ca54b3eb83069f
refs/heads/master: cc7993f6439b49909a8792660c4d0741fec9d584
9 changes: 9 additions & 0 deletions trunk/drivers/video/backlight/pwm_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ struct pwm_bl_data {
unsigned int lth_brightness;
int (*notify)(struct device *,
int brightness);
void (*notify_after)(struct device *,
int brightness);
int (*check_fb)(struct device *, struct fb_info *);
};

Expand Down Expand Up @@ -55,6 +57,10 @@ static int pwm_backlight_update_status(struct backlight_device *bl)
pwm_config(pb->pwm, brightness, pb->period);
pwm_enable(pb->pwm);
}

if (pb->notify_after)
pb->notify_after(pb->dev, brightness);

return 0;
}

Expand Down Expand Up @@ -105,6 +111,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)

pb->period = data->pwm_period_ns;
pb->notify = data->notify;
pb->notify_after = data->notify_after;
pb->check_fb = data->check_fb;
pb->lth_brightness = data->lth_brightness *
(data->pwm_period_ns / data->max_brightness);
Expand Down Expand Up @@ -172,6 +179,8 @@ static int pwm_backlight_suspend(struct platform_device *pdev,
pb->notify(pb->dev, 0);
pwm_config(pb->pwm, 0, pb->period);
pwm_disable(pb->pwm);
if (pb->notify_after)
pb->notify_after(pb->dev, 0);
return 0;
}

Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/pwm_backlight.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ struct platform_pwm_backlight_data {
unsigned int pwm_period_ns;
int (*init)(struct device *dev);
int (*notify)(struct device *dev, int brightness);
void (*notify_after)(struct device *dev, int brightness);
void (*exit)(struct device *dev);
int (*check_fb)(struct device *dev, struct fb_info *info);
};
Expand Down

0 comments on commit 344522b

Please sign in to comment.