All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] backlight: pwm_bl: Two PWM releated changes
@ 2023-01-20 12:00 ` Uwe Kleine-König
  0 siblings, 0 replies; 13+ messages in thread
From: Uwe Kleine-König @ 2023-01-20 12:00 UTC (permalink / raw)
  To: Lee Jones, Daniel Thompson, Jingoo Han, Liam Girdwood, Mark Brown
  Cc: Thierry Reding, Helge Deller, linux-pwm, dri-devel, linux-fbdev, kernel

Hello,

here comes the promised v2 of this series. Implicit v1 is available at
https://lore.kernel.org/dri-devel/20230109204758.610400-1-u.kleine-koenig@pengutronix.de
.

Changes since (implicit) v1 all due to feedback by Daniel Thompson:

 - Update changelogs
 - Still disable PWM if there is an enable gpio or a regulator

Best regards
Uwe

Uwe Kleine-König (2):
  backlight: pwm_bl: Configure pwm only once per backlight toggle
  backlight: pwm_bl: Don't rely on a disabled PWM emiting inactive state

 drivers/video/backlight/pwm_bl.c | 56 ++++++++++++++++++--------------
 1 file changed, 31 insertions(+), 25 deletions(-)


base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2
prerequisite-patch-id: a0c7497a32092d284bc47eda60e4b3690338ba6e
-- 
2.39.0


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [PATCH v2 1/2] backlight: pwm_bl: Configure pwm only once per backlight toggle
@ 2023-03-22  5:13 Aisheng Dong
  0 siblings, 0 replies; 13+ messages in thread
From: Aisheng Dong @ 2023-03-22  5:13 UTC (permalink / raw)
  To: u.kleine-koenig
  Cc: daniel.thompson, linux-pm, Jingoo Han, deller, lee, linux-fbdev,
	dri-devel, thierry.reding, kernel

[-- Attachment #1: Type: text/plain, Size: 1665 bytes --]

On Fri, Jan 20, 2023 at 01:00:18PM +0100, Uwe Kleine-König wrote:
> Most but not all PWMs drive the PWM pin to its inactive state when
> disabled. However if there is no enable_gpio and no regulator the PWM
> must drive the inactive state to actually disable the backlight.
>
> So keep the PWM on in this case.
>
> Note that to determine if there is a regulator some effort is required
> because it might happen that there isn't actually one but the regulator
> core gave us a dummy. (A nice side effect is that this makes the
> regulator actually optional even on fully constrained systems.)
>
> This fixes backlight disabling e.g. on i.MX6 when an inverted PWM is
> used.
>
> Hint for the future: If this change results in a regression, the bug is
> in the lowlevel PWM driver.
> Signed-off-by: Uwe Kleine-König u.kleine-koenig@pengutronix.de<mailto:u.kleine-koenig@pengutronix.de>

This patch broke imx7ulp suspend resume and got the following error:
Freezing remaining freezable tasks
Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
printk: Suspending console(s) (use no_console_suspend to debug)
asix 1-1:1.0 eth0: Link is Down
imx7ulp-tpm-pwm 40250000.pwm: PM: dpm_run_callback(): platform_pm_suspend+0x0/0x48 returns -16
imx7ulp-tpm-pwm 40250000.pwm: PM: failed to suspend: error -16
...

It seems this patch changed the behavior of pwm_backlight_suspend a little bit in
pwm_backlight_power_off() that pwm state keep unchanged during suspend.
Then pwm_imx_tpm_suspend() will return -Ebusy due to tpm->enable_count > 0.
Was this intended behavior? Should we fix pwm core or the driver?

Regards
Aisheng

[-- Attachment #2: Type: text/html, Size: 5796 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2023-03-22  8:20 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-20 12:00 [PATCH v2 0/2] backlight: pwm_bl: Two PWM releated changes Uwe Kleine-König
2023-01-20 12:00 ` Uwe Kleine-König
2023-01-20 12:00 ` [PATCH v2 1/2] backlight: pwm_bl: Configure pwm only once per backlight toggle Uwe Kleine-König
2023-01-20 12:00   ` Uwe Kleine-König
2023-01-20 17:07   ` Lee Jones
2023-01-20 17:07     ` Lee Jones
2023-01-20 12:00 ` [PATCH v2 2/2] backlight: pwm_bl: Don't rely on a disabled PWM emiting inactive state Uwe Kleine-König
2023-01-20 12:00   ` Uwe Kleine-König
2023-01-20 15:04   ` Daniel Thompson
2023-01-20 15:04     ` Daniel Thompson
2023-01-20 17:07   ` Lee Jones
2023-01-20 17:07     ` Lee Jones
2023-03-22  5:13 [PATCH v2 1/2] backlight: pwm_bl: Configure pwm only once per backlight toggle Aisheng Dong

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.