Re: [PATCH] pwm: berlin: Fix wrong register in suspend/resume
From: Uwe Kleine-König
Date: Sun Aug 17 2025 - 06:52:40 EST
Hello,
On Fri, Aug 15, 2025 at 11:10:16AM +0800, Jisheng Zhang wrote:
> The 'enable' register should be BERLIN_PWM_EN rather than
> BERLIN_PWM_ENABLE.
>
> Fixes: bbf0722c1c66 ("pwm: berlin: Add suspend/resume support")
> Signed-off-by: Jisheng Zhang <jszhang@xxxxxxxxxx>
> ---
> drivers/pwm/pwm-berlin.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pwm/pwm-berlin.c b/drivers/pwm/pwm-berlin.c
> index 831aed228caf..858d36991374 100644
> --- a/drivers/pwm/pwm-berlin.c
> +++ b/drivers/pwm/pwm-berlin.c
> @@ -234,7 +234,7 @@ static int berlin_pwm_suspend(struct device *dev)
> for (i = 0; i < chip->npwm; i++) {
> struct berlin_pwm_channel *channel = &bpc->channel[i];
>
> - channel->enable = berlin_pwm_readl(bpc, i, BERLIN_PWM_ENABLE);
> + channel->enable = berlin_pwm_readl(bpc, i, BERLIN_PWM_EN);
BERLIN_PWM_ENABLE is 1 and BERLIN_PWM_EN is 0. What is the effect? Is
the low bit just ignored and the right thing happens? Or does this
result in a bus exception and the machine catches fire?
If it's more the latter than the former, I wonder how that didn't pop up
earlier.
Best regards
Uwe
Attachment:
signature.asc
Description: PGP signature