From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alper Nebi Yasak Date: Fri, 25 Sep 2020 18:55:01 +0300 Subject: [PATCH 1/2] video: backlight: Support PWMs without a known period_ns In-Reply-To: References: <20200923165231.18188-1-alpernebiyasak@gmail.com> Message-ID: <39b0b36c-9e96-86de-eea9-c1538fdfc9a0@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 24/09/2020 19:08, Simon Glass wrote: > Hi Alper, > > On Wed, 23 Sep 2020 at 10:52, Alper Nebi Yasak 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 >> --- >> >> 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)