[PATCH 1/2] video: backlight: Support PWMs without a known period_ns

Alper Nebi Yasak alpernebiyasak at gmail.com
Fri Sep 25 17:55:01 CEST 2020


On 24/09/2020 19:08, Simon Glass wrote:
> Hi Alper,
> 
> On Wed, 23 Sep 2020 at 10:52, Alper Nebi Yasak <alpernebiyasak at gmail.com> wrote:
>>
>> The PWM device provided by Chrome OS EC doesn't really support anything
>> other than setting a relative duty cycle. To support it as a backlight,
>> this patch makes the PWM period optional in the device tree and pretends
>> the valid brightness range is its period_ns.
>>
>> Signed-off-by: Alper Nebi Yasak <alpernebiyasak at gmail.com>
>> ---
>>
>>  drivers/video/pwm_backlight.c | 20 ++++++++++++++------
>>  1 file changed, 14 insertions(+), 6 deletions(-)
> 
> This looks OK.
> 
> But please update the comment for pwm_set_config() to describe the
> param updates and add a sandbox test to pwm.c

OK. I'm also adding the same comment to pwm_ops->set_config() as it has
the same change in its meaning.

> Does this affect the devicetree binding?

I don't think it does, or more precisely I'm making the backlight driver
support the following where I think the bindings themselves were already
valid:

    pwm: pwm {
        #pwm-cells = <1>;
        [...]
    };

    backlight: backlight {
        compatible = "pwm-backlight";
	pwms = <&pwm 0>;
        [...]
    };

(These with &cros-ec-pwm already exist in rk3399-gru-bob.dts and
rk3399-gru-kevin.dts)


More information about the U-Boot mailing list