[PATCH] pwm: atmel-tcb: Fix the channel restart write on resume

From: Zhu Jun

Date: Thu Nov 12 2026 - 02:31:54 EST


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@xxxxxxxxxxxxxxxxxxxx>
---
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