[PATCH v2 2/2] pwm: Add a driver for Chrome OS EC PWM

Arnaud Patard (Rtp) arnaud.patard at rtp-net.org
Sun Sep 27 11:29:28 CEST 2020


Peter Robinson <pbrobinson at gmail.com> writes:

> On Sat, Sep 26, 2020 at 9:09 PM Alper Nebi Yasak
> <alpernebiyasak at gmail.com> wrote:
>>
>> This PWM is used in rk3399-gru-bob and rk3399-gru-kevin to control
>> the display brightness. We can only change the duty cycle, so on
>> set_config() we just try to match the duty cycle that dividing duty_ns
>> by period_ns gives us. To disable, we set the duty cycle to zero while
>> keeping the old value for when we want to re-enable it.
>>
>> The cros_ec_set_pwm_duty() function is taken from Depthcharge's
>> cros_ec_set_bl_pwm_duty() but modified to use the generic pwm type.
>> The driver itself is very loosely based on rk_pwm.c for the general pwm
>> driver structure.
>>
>> The devicetree binding file is from Linux, before it was converted to
>> YAML at 5df5a577a6b4 ("dt-bindings: pwm: Convert google,cros-ec-pwm.txt
>> to YAML format") in their repo.
>>
>> Signed-off-by: Alper Nebi Yasak <alpernebiyasak at gmail.com>
>> ---
>> I'm testing on a rk3399-gru-kevin with a lot of other patches to get it
>> (and it's screen) barely working, but using something like the following
>> in a rk_board_late_init() added to gru.c gets the backlight to change:
>
> A quick look at the Linux DT for the GRU Chromebooks and it looks like
> the panels are also attached via EDP like on the Pinebook Pro so this
> patch series adding initial support for the rk3399 EDP might be of use
> here as well:
>
> https://lists.denx.de/pipermail/u-boot/2020-September/427790.html
>

If this platform has a screen on rk3399 edp, I'll be happy to get tests /
comments / ... of my patches on it. I've only a pinebook pro, so it's
hard to know if something is platform specific or not, I'm thinking of
the hack I'm using for resetting the display [1] on reboot but there may
be other things.

Arnaud


[1] http://people.hupstream.com/~rtp/pbp/20200911/hack-reset.patch


More information about the U-Boot mailing list