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

Simon Glass sjg at chromium.org
Mon Sep 28 06:24:39 CEST 2020


On Sat, 26 Sep 2020 at 14:09, 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.
>
> 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 at gmail.com>
> ---
>
> Changes in v2:
> - Add sandbox test to pwm.c (using sandbox_pwm's channel 2)
> - Add comments to pwm_set_config() and pwm_ops->set_config()
>
> v1: https://patchwork.ozlabs.org/project/uboot/patch/20200923165231.18188-1-alpernebiyasak@gmail.com/
>
>  drivers/pwm/sandbox_pwm.c     | 11 +++++++++--
>  drivers/video/pwm_backlight.c | 20 ++++++++++++++------
>  include/pwm.h                 |  8 ++++++++
>  test/dm/pwm.c                 | 11 +++++++++++
>  4 files changed, 42 insertions(+), 8 deletions(-)
>

Reviewed-by: Simon Glass <sjg at chromium.org>


More information about the U-Boot mailing list