Skip to contentSkip to conversation

video: backlight: fix pwm invertation

PATCH New marvin24 at posteo.de 2 participants 3 messages Jul 2, 2019 – Jul 7, 2019 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 video: backlight: fix pwm invertation

Fixes 57e7775413 ("video: backlight: Parse PWM polarity cell")

set_pwm will always fail with -ENOSYS if pwm_set_invert is not implemented, leaving the backlight dark. Fix this by returning no error if pwm_set_invert is not implemented and no polarity change is requested.

v2: simplify logic

---
 drivers/video/pwm_backlight.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/video/pwm_backlight.c +3 -0
index a587977c22..ad20bf2441 100644
@@ -67,6 +67,9 @@ static int set_pwm(struct pwm_backlight_priv *priv)
                return log_ret(ret);
 
        ret = pwm_set_invert(priv->pwm, priv->channel, priv->polarity);
+       if (ret == -ENOSYS && !priv->polarity)
+               ret = 0;
+
        return log_ret(ret);
 }
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/1 video: backlight: fix pwm invertation

Quoted 9 lines · On Tue, 02 Jul 2019 22:08:33 +0200 marvin24 at posteo.de marvin24 at posteo.de…
Fixes 57e7775413 ("video: backlight: Parse PWM polarity cell")

set_pwm will always fail with -ENOSYS if pwm_set_invert is not implemented, leaving the backlight dark. Fix this by returning no error if pwm_set_invert is not implemented and no polarity change is requested.

v2: simplify logic

#2 lore raw

PATCH v2 1/1 video: backlight: fix pwm invertation

In reply to marvin24 at posteo.de

On Tue, 02 Jul 2019 22:08:33 +0200 marvin24 at posteo.de marvin24 at posteo.de wrote:
...

Quoted 2 lines
 drivers/video/pwm_backlight.c | 3 +++
 1 file changed, 3 insertions(+)

Applied to u-boot-video/master, thanks!

--
Anatolij