From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnaud Patard (Rtp) Date: Sun, 27 Sep 2020 11:29:28 +0200 Subject: [PATCH v2 2/2] pwm: Add a driver for Chrome OS EC PWM In-Reply-To: (Peter Robinson's message of "Sun, 27 Sep 2020 08:27:22 +0100") References: <20200926200851.4388-1-alpernebiyasak@gmail.com> <20200926200851.4388-2-alpernebiyasak@gmail.com> Message-ID: <87wo0fpnyf.fsf@lechat.rtp-net.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Peter Robinson writes: > On Sat, Sep 26, 2020 at 9:09 PM Alper Nebi Yasak > 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 >> --- >> 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