mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] pwm: atmel-tcb: Fix the channel restart write on resume
@ 2026-11-12  7:16 Zhu Jun
  2026-11-20 16:06 ` Uwe Kleine-König
  0 siblings, 1 reply; 2+ messages in thread
From: Zhu Jun @ 2026-11-12  7:16 UTC (permalink / raw)
  To: ukleinek
  Cc: nicolas.ferre, alexandre.belloni, claudiu.beznea, linux-pwm,
	linux-arm-kernel, linux-kernel, Zhu Jun

atmel_tcb_pwm_resume() passes the start command as the register address
and the channel control register offset as the value. The command is
0x5, which is not an aligned register address, so regmap rejects the
write and an enabled PWM channel is not restarted after resume.

Pass the channel control register first and the clock-enable and
software-trigger bits second.

Fixes: 061f8572a31c ("pwm: atmel-tcb: Switch to new binding")
Signed-off-by: Zhu Jun <zhujun2@cmss.chinamobile.com>
---
 drivers/pwm/pwm-atmel-tcb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pwm/pwm-atmel-tcb.c b/drivers/pwm/pwm-atmel-tcb.c
index f74a42d75b81..e878eaaf81cc 100644
--- a/drivers/pwm/pwm-atmel-tcb.c
+++ b/drivers/pwm/pwm-atmel-tcb.c
@@ -541,8 +541,8 @@ static int atmel_tcb_pwm_resume(struct device *dev)
 
 	if (chan->enabled)
 		regmap_write(tcbpwmc->regmap,
-			     ATMEL_TC_CLKEN | ATMEL_TC_SWTRG,
-			     ATMEL_TC_REG(channel, CCR));
+			     ATMEL_TC_REG(channel, CCR),
+			     ATMEL_TC_CLKEN | ATMEL_TC_SWTRG);
 
 	return 0;
 }
-- 
2.51.0




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

end of thread, other threads:[~2026-11-20 16:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12  7:16 [PATCH] pwm: atmel-tcb: Fix the channel restart write on resume Zhu Jun
2026-11-20 16:06 ` Uwe Kleine-König

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®