Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319225
b: refs/heads/master
c: 9fb978b
h: refs/heads/master
i:
  319223: 1be0dd8
v: v3
  • Loading branch information
Alexandre Courbot authored and Thierry Reding committed Jul 23, 2012
1 parent 6a93c6e commit 3ffe63d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2437b0d95c609365ce88039b96a1c020af71c6dc
refs/heads/master: 9fb978b12f9cc2b4df428764273d96877d0a262d
12 changes: 8 additions & 4 deletions trunk/drivers/video/backlight/pwm_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,18 @@ static int pwm_backlight_update_status(struct backlight_device *bl)
pwm_config(pb->pwm, 0, pb->period);
pwm_disable(pb->pwm);
} else {
int duty_cycle;

if (pb->levels) {
brightness = pb->levels[brightness];
duty_cycle = pb->levels[brightness];
max = pb->levels[max];
} else {
duty_cycle = brightness;
}

brightness = pb->lth_brightness +
(brightness * (pb->period - pb->lth_brightness) / max);
pwm_config(pb->pwm, brightness, pb->period);
duty_cycle = pb->lth_brightness +
(duty_cycle * (pb->period - pb->lth_brightness) / max);
pwm_config(pb->pwm, duty_cycle, pb->period);
pwm_enable(pb->pwm);
}

Expand Down

0 comments on commit 3ffe63d

Please sign in to comment.