[U-Boot] [PATCH] video: backlight: fix pwm invertation

Fixes: 57e7775413 ("video: backlight: Parse PWM polarity cell")
set_pwm will always fail if pwm_set_invert is not implemented, leaving the backlight dark. Fix this by calling pwm_set_invert only if pwm is inverted.
Signed-off-by: Marc Dietrich marvin24@gmx.de --- drivers/video/pwm_backlight.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/video/pwm_backlight.c b/drivers/video/pwm_backlight.c index a587977c22..26bcbeb42b 100644 --- a/drivers/video/pwm_backlight.c +++ b/drivers/video/pwm_backlight.c @@ -61,12 +61,13 @@ static int set_pwm(struct pwm_backlight_priv *priv)
duty_cycle = priv->period_ns * (priv->cur_level - priv->min_level) / (priv->max_level - priv->min_level + 1); + ret = pwm_set_config(priv->pwm, priv->channel, priv->period_ns, duty_cycle); - if (ret) - return log_ret(ret);
- ret = pwm_set_invert(priv->pwm, priv->channel, priv->polarity); + if (!ret && priv->polarity) + ret = pwm_set_invert(priv->pwm, priv->channel, priv->polarity); + return log_ret(ret); }
-- 2.17.1

Am Freitag, 21. Juni 2019, 22:01:35 CEST schrieb Marc Dietrich:
Fixes: 57e7775413 ("video: backlight: Parse PWM polarity cell")
set_pwm will always fail if pwm_set_invert is not implemented, leaving the backlight dark. Fix this by calling pwm_set_invert only if pwm is inverted.
Signed-off-by: Marc Dietrich marvin24@gmx.de
ping?
drivers/video/pwm_backlight.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/video/pwm_backlight.c b/drivers/video/pwm_backlight.c index a587977c22..26bcbeb42b 100644 --- a/drivers/video/pwm_backlight.c +++ b/drivers/video/pwm_backlight.c @@ -61,12 +61,13 @@ static int set_pwm(struct pwm_backlight_priv *priv)
duty_cycle = priv->period_ns * (priv->cur_level - priv->min_level) / (priv->max_level - priv->min_level + 1);
- ret = pwm_set_config(priv->pwm, priv->channel, priv->period_ns, duty_cycle);
if (ret)
return log_ret(ret);
ret = pwm_set_invert(priv->pwm, priv->channel, priv->polarity);
- if (!ret && priv->polarity)
ret = pwm_set_invert(priv->pwm, priv->channel, priv->polarity);
- return log_ret(ret);
}
-- 2.17.1

This patch fixes the panel on my device (paz00). Can it be applied to 2019-07 ?
Thx in advance
Le jeu. 27 juin 2019 à 21:52, Marc Dietrich marvin24@gmx.de a écrit :
Am Freitag, 21. Juni 2019, 22:01:35 CEST schrieb Marc Dietrich:
Fixes: 57e7775413 ("video: backlight: Parse PWM polarity cell")
set_pwm will always fail if pwm_set_invert is not implemented, leaving the backlight dark. Fix this by calling pwm_set_invert only if pwm is inverted.
Signed-off-by: Marc Dietrich marvin24@gmx.de
ping?
drivers/video/pwm_backlight.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/video/pwm_backlight.c b/drivers/video/pwm_backlight.c index a587977c22..26bcbeb42b 100644 --- a/drivers/video/pwm_backlight.c +++ b/drivers/video/pwm_backlight.c @@ -61,12 +61,13 @@ static int set_pwm(struct pwm_backlight_priv *priv)
duty_cycle = priv->period_ns * (priv->cur_level - priv->min_level) / (priv->max_level - priv->min_level + 1);
ret = pwm_set_config(priv->pwm, priv->channel, priv->period_ns, duty_cycle);
if (ret)
return log_ret(ret);
ret = pwm_set_invert(priv->pwm, priv->channel, priv->polarity);
if (!ret && priv->polarity)
ret = pwm_set_invert(priv->pwm, priv->channel, priv->polarity);
return log_ret(ret);
}
-- 2.17.1
U-Boot mailing list U-Boot@lists.denx.de https://lists.denx.de/listinfo/u-boot
-- -
Nicolas (kwizart)
participants (2)
-
Marc Dietrich
-
Nicolas Chauvet