video: backlight: fix pwm's duty cycle calculation
For levels equal to the maximum value, the duty cycle must be equal to the period. Signed-off-by: Dario Binacchi <dariobin@libero.it> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
committed by
Anatolij Gustschin
parent
f9b94055bd
commit
76c2ff3e5f
@@ -63,7 +63,7 @@ static int set_pwm(struct pwm_backlight_priv *priv)
|
||||
int ret;
|
||||
|
||||
duty_cycle = priv->period_ns * (priv->cur_level - priv->min_level) /
|
||||
(priv->max_level - priv->min_level + 1);
|
||||
(priv->max_level - priv->min_level);
|
||||
ret = pwm_set_config(priv->pwm, priv->channel, priv->period_ns,
|
||||
duty_cycle);
|
||||
if (ret)
|
||||
|
||||
Reference in New Issue
Block a user