diff options
-rw-r--r-- | drivers/video/backlight/pwm_bl.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 9bd17682655a..1c2289ddd555 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c | |||
@@ -79,14 +79,17 @@ static void pwm_backlight_power_off(struct pwm_bl_data *pb) | |||
79 | static int compute_duty_cycle(struct pwm_bl_data *pb, int brightness) | 79 | static int compute_duty_cycle(struct pwm_bl_data *pb, int brightness) |
80 | { | 80 | { |
81 | unsigned int lth = pb->lth_brightness; | 81 | unsigned int lth = pb->lth_brightness; |
82 | int duty_cycle; | 82 | u64 duty_cycle; |
83 | 83 | ||
84 | if (pb->levels) | 84 | if (pb->levels) |
85 | duty_cycle = pb->levels[brightness]; | 85 | duty_cycle = pb->levels[brightness]; |
86 | else | 86 | else |
87 | duty_cycle = brightness; | 87 | duty_cycle = brightness; |
88 | 88 | ||
89 | return (duty_cycle * (pb->period - lth) / pb->scale) + lth; | 89 | duty_cycle *= pb->period - lth; |
90 | do_div(duty_cycle, pb->scale); | ||
91 | |||
92 | return duty_cycle + lth; | ||
90 | } | 93 | } |
91 | 94 | ||
92 | static int pwm_backlight_update_status(struct backlight_device *bl) | 95 | static int pwm_backlight_update_status(struct backlight_device *bl) |