public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: marvin24 at posteo.de <marvin24@posteo.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] video: backlight: fix pwm invertation
Date: Tue, 02 Jul 2019 22:08:33 +0200	[thread overview]
Message-ID: <31882144.cceQhDUPd6@ax5200p> (raw)

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

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
---
 drivers/video/pwm_backlight.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/video/pwm_backlight.c b/drivers/video/pwm_backlight.c
index a587977c22..ad20bf2441 100644
--- a/drivers/video/pwm_backlight.c
+++ b/drivers/video/pwm_backlight.c
@@ -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);
 }
 
-- 
2.17.1

             reply	other threads:[~2019-07-02 20:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-02 20:08 marvin24 at posteo.de [this message]
2019-07-02 21:04 ` [U-Boot] [PATCH v2] video: backlight: fix pwm invertation Anatolij Gustschin
2019-07-07 13:50 ` Anatolij Gustschin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=31882144.cceQhDUPd6@ax5200p \
    --to=marvin24@posteo.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox