aboutsummaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorMarc Dietrich2019-07-02 22:08:33 +0200
committerAnatolij Gustschin2019-07-06 23:31:52 +0200
commita2c4ef097774e70f0afc4ab25f53b769c6da3397 (patch)
treed12e595c7ce710091235320838dd6eaa00b0741a /drivers/video
parent1f83431f0053f6fb20c511c391ffc687433848cf (diff)
video: backlight: fix pwm inversion
set_pwm() will always fail with -ENOSYS if pwm_ops set_invert() is not implemented, leaving the backlight dark. Fix this by returning no error if set_invert() is not implemented and no polarity change is requested. Fixes: 57e7775413 ("video: backlight: Parse PWM polarity cell") Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/pwm_backlight.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/video/pwm_backlight.c b/drivers/video/pwm_backlight.c
index a587977c225..ad20bf2441f 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);
}