[U-Boot] [PATCH] video: backlight: fix pwm invertation
Stefan Mavrodiev
stefan at olimex.com
Tue Jul 2 09:08:45 UTC 2019
On 7/2/19 12:05 PM, Stefan Mavrodiev wrote:
> Hi,
>
> On 7/2/19 11:42 AM, Nicolas Chauvet wrote:
>> Le mar. 2 juil. 2019 à 09:41, Stefan Mavrodiev <stefan at olimex.com> a
>> écrit :
>>> Hi,
>>>
>>> On 6/27/19 9:56 PM, marvin24 at posteo.de wrote:
>>>> 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.
>>> I'm not sure if this is true. pwm_set_invert() checks for .set_invert.
>>> Which pwm driver you're using?
>> This is drivers/pwm/pwm_tegra.c
>> Here .set_invert is not implemented.
>>
>> Thx for the review.
>>
> You're right. Some drivers has #pwm-cells = <2> and in this case
> polarity is 0.
>
> However your approach is wrong. You will break other drivers with
> #pwm-cells = <3>.
> I think your patch should look something like this:
>
> ret = pwm_set_invert(priv->pwm, priv->channel, priv->polarity);
> if (ret == -ENOSYS)
> ret = 0;
>
> return log_ret(ret);
You should ask the custodians to review this.
>
> This will not return error if set_inverted is not implemented.
> Stefan
>
More information about the U-Boot
mailing list