diff options
-rw-r--r-- | drivers/video/backlight/pwm_bl.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 057389d69a51..995f0164c9b0 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c | |||
@@ -54,14 +54,18 @@ static int pwm_backlight_update_status(struct backlight_device *bl) | |||
54 | pwm_config(pb->pwm, 0, pb->period); | 54 | pwm_config(pb->pwm, 0, pb->period); |
55 | pwm_disable(pb->pwm); | 55 | pwm_disable(pb->pwm); |
56 | } else { | 56 | } else { |
57 | int duty_cycle; | ||
58 | |||
57 | if (pb->levels) { | 59 | if (pb->levels) { |
58 | brightness = pb->levels[brightness]; | 60 | duty_cycle = pb->levels[brightness]; |
59 | max = pb->levels[max]; | 61 | max = pb->levels[max]; |
62 | } else { | ||
63 | duty_cycle = brightness; | ||
60 | } | 64 | } |
61 | 65 | ||
62 | brightness = pb->lth_brightness + | 66 | duty_cycle = pb->lth_brightness + |
63 | (brightness * (pb->period - pb->lth_brightness) / max); | 67 | (duty_cycle * (pb->period - pb->lth_brightness) / max); |
64 | pwm_config(pb->pwm, brightness, pb->period); | 68 | pwm_config(pb->pwm, duty_cycle, pb->period); |
65 | pwm_enable(pb->pwm); | 69 | pwm_enable(pb->pwm); |
66 | } | 70 | } |
67 | 71 | ||