Re: [PATCH] pwm: tiecap: Implement .get_state() and keep a running PWM

From: Uwe Kleine-König

Date: Fri Nov 27 2026 - 10:40:22 EST


Hello,

On Mon, Nov 16, 2026 at 03:22:51PM +0100, Màxim Pedraza Padilla wrote:
> The driver has no .get_state(), so a PWM left running by the bootloader,
> for instance for a backlight, is seen as disabled and the consumer may
> turn it off before enabling it again, which makes the screen flicker.
>
> Read the state from the hardware. While the PWM runs, .apply() writes
> the shadow registers, loaded at the end of the period, so read those to
> stay consistent with it, and copy the active values into them at probe
> in case the bootloader didn't set them.
>
> A running PWM also holds the runtime PM reference ecap_pwm_enable()
> takes, so take it at probe. Switch to devm_pm_runtime_enable() so the
> remove callback can go.
>
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Màxim Pedraza Padilla <maximpedraza@xxxxxxxxx>

I applied this to

https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next

Thanks!

Best regards
Uwe

Attachment: signature.asc
Description: PGP signature