diff options
author | Dario Binacchi <dariobin@libero.it> | 2020-10-11 15:28:04 +0300 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2020-10-18 16:07:33 +0300 |
commit | 76c2ff3e5fd8068b433acbb0e76d33fa5116dade (patch) | |
tree | 3baaf2748b10f35d80c1ee06477e63f1fba5d778 /drivers/video/pwm_backlight.c | |
parent | f9b94055bdde93a302075ff86a1046b98e2c8e05 (diff) | |
download | u-boot-76c2ff3e5fd8068b433acbb0e76d33fa5116dade.tar.xz |
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>
Diffstat (limited to 'drivers/video/pwm_backlight.c')
-rw-r--r-- | drivers/video/pwm_backlight.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/video/pwm_backlight.c b/drivers/video/pwm_backlight.c index acfde7ba3d..9519180ceb 100644 --- a/drivers/video/pwm_backlight.c +++ b/drivers/video/pwm_backlight.c @@ -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) |