Re: [PATCH v1 0/5] pwm: tiecap: Assorted fixes and improvements
From: Màxim Pedraza Padilla
Date: Tue Dec 01 2026 - 04:03:37 EST
Hello Uwe,
On Fri, Nov 27, 2026 at 06:39:39PM +0100, Uwe Kleine-König wrote:
> I didn't mark the 2nd patch as a fix as it might result in power
> regressions during suspend as the clock is kept enabled there. So it
> would be awesome if someone with the hardware could test that.
Thanks for picking up the .get_state() patch, and for the series.
I tested it on an AM3354 board with eCAP0 driving a pwm-backlight, left
running by U-Boot, on a v7.4-rc2 based tree with PWM_DEBUG enabled,
comparing the kernel with and without the series:
- The backlight inherited from the bootloader is taken over unchanged
(83330/125000 ns), all brightness levels apply as expected and the
CAP registers match the requested state. No PWM_DEBUG warnings.
- Suspend with pm_test=devices, for both freeze and mem, with the
backlight on and off: the PWM comes back with the same state, same
result as without the series.
- Through sysfs: a 5 ns period (below one 10 ns tick) now fails with
-EINVAL, where before it was applied as 10 ns and PWM_DEBUG
complained about rounding up. Periods above 1 s, which used to give
-ERANGE, now work: 2 s and 42.9 s are applied, and 50 s saturates at
0xffffffff ticks and is reported as 42949672950 ns. Duty cycles of 0,
50 and 100 % and inversed polarity are fine.
- With the series, l4ls_gclk has one more enable/prepare count and a
protect count of 1, and nothing complains about the rate lock.
About the power concern with patch 2: on AM335x the "fck" of the eCAP
is l4ls_gclk, a fixed-factor clock without a gate, so keeping it
enabled doesn't change the hardware. The module is gated by runtime PM
through ti-sysc, which the series doesn't touch: with the PWM disabled,
CM_PER_EPWMSS0_CLKCTRL reads 0x00030000 (module disabled) with and
without the series. So I don't expect any difference there. I haven't
measured the current yet; I plan to put a shunt in the VDD_CORE rail
and will report back if it shows anything.
Tested-by: Màxim Pedraza Padilla <maximpedraza@xxxxxxxxx>
Best regards,
Màxim