All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org>
To: u-boot@lists.denx.de
Subject: [PATCH v2 2/2] pwm: Add a driver for Chrome OS EC PWM
Date: Sun, 27 Sep 2020 11:29:28 +0200	[thread overview]
Message-ID: <87wo0fpnyf.fsf@lechat.rtp-net.org> (raw)
In-Reply-To: <CALeDE9NL1qwLuRYfiipr3_3vgiDZJb_+H-CtPKPWGtJmmjX+Yg@mail.gmail.com> (Peter Robinson's message of "Sun, 27 Sep 2020 08:27:22 +0100")

Peter Robinson <pbrobinson@gmail.com> writes:

> On Sat, Sep 26, 2020 at 9:09 PM Alper Nebi Yasak
> <alpernebiyasak@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@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

  reply	other threads:[~2020-09-27  9:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-26 20:08 [PATCH v2 1/2] video: backlight: Support PWMs without a known period_ns Alper Nebi Yasak
2020-09-26 20:08 ` [PATCH v2 2/2] pwm: Add a driver for Chrome OS EC PWM Alper Nebi Yasak
2020-09-27  7:27   ` Peter Robinson
2020-09-27  9:29     ` Arnaud Patard [this message]
2020-09-27 15:49       ` Alper Nebi Yasak
2020-09-28  4:24   ` Simon Glass
2020-09-28  4:24 ` [PATCH v2 1/2] video: backlight: Support PWMs without a known period_ns Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wo0fpnyf.fsf@lechat.rtp-net.org \
    --to=arnaud.patard@rtp-net.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.