]> git.baikalelectronics.ru Git - uboot.git/commit
video: backlight: Support PWMs without a known period_ns
authorAlper Nebi Yasak <alpernebiyasak@gmail.com>
Thu, 22 Oct 2020 20:49:26 +0000 (23:49 +0300)
committerAnatolij Gustschin <agust@denx.de>
Sat, 10 Apr 2021 14:07:12 +0000 (16:07 +0200)
commit7b34e7b2a8c2079333fa35b8b9d7d5e8fef76dab
tree4ae09212a60da99436d30eb24b3f9d041553cdbe
parentcd3a29622ee60be0e30115839bf9854f23ff2f8e
video: backlight: Support PWMs without a known period_ns

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.

Also adds a sandbox test for a PWM channel that has a fixed period,
checking that the resulting duty_cycle matches on a set_config() even if
the requested period_ns can't be set.

Signed-off-by: Alper Nebi Yasak <alpernebiyasak@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/pwm/sandbox_pwm.c
drivers/video/pwm_backlight.c
include/pwm.h
test/dm/pwm.c