[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5302741318a28e39239db08a1f05ecb7@pascalroeleven.nl>
Date: Wed, 02 Sep 2020 21:42:49 +0200
From: Pascal Roeleven <dev@...calroeleven.nl>
To: Andrey Lebedev <andrey@...edev.lt>
Cc: Daniel Thompson <daniel.thompson@...aro.org>,
Thierry Reding <thierry.reding@...il.com>,
Uwe Kleine-König <u.kleine-koenig@...gutronix.de>,
Lee Jones <lee.jones@...aro.org>,
Maxime Ripard <mripard@...nel.org>,
Chen-Yu Tsai <wens@...e.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
"open list:PWM SUBSYSTEM" <linux-pwm@...r.kernel.org>,
"moderated list:ARM/Allwinner sunXi SoC support"
<linux-arm-kernel@...ts.infradead.org>,
open list <linux-kernel@...r.kernel.org>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Emil Lenngren <emil.lenngren@...il.com>
Subject: Re: pwm-sun4i: PWM backlight is not turned off on shutdown
Thank you for adding me. Emil (also added now) and I spent a while on
trying to figure out how to solve this. The Allwinner PWM controller has
some quirks.
Unfortunately I never got around to perform some more tests and fix it
indefinitely. It's still on my todo list..
> On 9/2/20 12:54 PM, Daniel Thompson wrote:
>> There's some rather odd logic in sun4i_pwm_apply() that results in the
>> PWM being disabled twice... once when it applies the initial config
>> and again after waiting for a duty_cycle.
That's true. To properly turn off the controller you have to turn the
controller off first and keep the gate on for at least two full clock
cycles. Then the gate must be turned off. Otherwise it might get stuck.
That's probably what is trying to be done here.
On 2020-09-02 21:05, Andrey Lebedev wrote:
> Indeed, this fixes the issue for me. The display goes dark reliably on
> writing 4 to "/sys/.../bl_power" as well as when system is halted. I
> did
> not notice any negative side effects so far.
Problems start to arise when combining bl_power and brightness setting
in a particular order or at the same time (with for example a backlight
driver which sets both bl_power and brightness). I can't recall exactly
what caused problems and when, but one thing I was sure of is that
timing was of the essence. Once I added some delays here and there it
started to work.
If this patch works for you then that's great, but unfortunately it
isn't a complete solution.
Regards,
Pascal
Powered by blists - more mailing lists