* [PATCH] pwm: adp5585: Set OSC_EN bit to 1 when PWM state is enabled
@ 2024-08-26 8:33 Liu Ying
2024-08-26 8:50 ` Laurent Pinchart
0 siblings, 1 reply; 3+ messages in thread
From: Liu Ying @ 2024-08-26 8:33 UTC (permalink / raw)
To: linux-gpio, linux-pwm, linux-kernel
Cc: laurent.pinchart, ukleinek, xiaoning.wang, Frank.Li, lee
It turns out that OSC_EN bit in GERNERAL_CFG register has to be set to 1
when PWM state is enabled, otherwise PWM signal won't be generated.
Fixes: e9b503879fd2 ("pwm: adp5585: Add Analog Devices ADP5585 support")
Signed-off-by: Liu Ying <victor.liu@nxp.com>
---
drivers/pwm/pwm-adp5585.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/pwm/pwm-adp5585.c b/drivers/pwm/pwm-adp5585.c
index ed7e8c6bcf32..40472ac5db64 100644
--- a/drivers/pwm/pwm-adp5585.c
+++ b/drivers/pwm/pwm-adp5585.c
@@ -100,6 +100,10 @@ static int pwm_adp5585_apply(struct pwm_chip *chip,
if (ret)
return ret;
+ ret = regmap_set_bits(regmap, ADP5585_GENERAL_CFG, ADP5585_OSC_EN);
+ if (ret)
+ return ret;
+
return regmap_set_bits(regmap, ADP5585_PWM_CFG, ADP5585_PWM_EN);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] pwm: adp5585: Set OSC_EN bit to 1 when PWM state is enabled
2024-08-26 8:33 [PATCH] pwm: adp5585: Set OSC_EN bit to 1 when PWM state is enabled Liu Ying
@ 2024-08-26 8:50 ` Laurent Pinchart
2024-09-03 16:20 ` Uwe Kleine-König
0 siblings, 1 reply; 3+ messages in thread
From: Laurent Pinchart @ 2024-08-26 8:50 UTC (permalink / raw)
To: Liu Ying
Cc: linux-gpio, linux-pwm, linux-kernel, ukleinek, xiaoning.wang,
Frank.Li, lee
Hi Liu,
Thank you for the patch.
On Mon, Aug 26, 2024 at 04:33:37PM +0800, Liu Ying wrote:
> It turns out that OSC_EN bit in GERNERAL_CFG register has to be set to 1
> when PWM state is enabled, otherwise PWM signal won't be generated.
Indeed, this likely got lost during one of the reworks. The apply
function correctly clears the bit when disabling PWM, but doesn't set it
otherwise.
> Fixes: e9b503879fd2 ("pwm: adp5585: Add Analog Devices ADP5585 support")
> Signed-off-by: Liu Ying <victor.liu@nxp.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Uwe, would you be able to queue this for v6.12 ?
> ---
> drivers/pwm/pwm-adp5585.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/drivers/pwm/pwm-adp5585.c b/drivers/pwm/pwm-adp5585.c
> index ed7e8c6bcf32..40472ac5db64 100644
> --- a/drivers/pwm/pwm-adp5585.c
> +++ b/drivers/pwm/pwm-adp5585.c
> @@ -100,6 +100,10 @@ static int pwm_adp5585_apply(struct pwm_chip *chip,
> if (ret)
> return ret;
>
> + ret = regmap_set_bits(regmap, ADP5585_GENERAL_CFG, ADP5585_OSC_EN);
> + if (ret)
> + return ret;
> +
> return regmap_set_bits(regmap, ADP5585_PWM_CFG, ADP5585_PWM_EN);
> }
>
--
Regards,
Laurent Pinchart
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] pwm: adp5585: Set OSC_EN bit to 1 when PWM state is enabled
2024-08-26 8:50 ` Laurent Pinchart
@ 2024-09-03 16:20 ` Uwe Kleine-König
0 siblings, 0 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2024-09-03 16:20 UTC (permalink / raw)
To: Laurent Pinchart
Cc: Liu Ying, linux-gpio, linux-pwm, linux-kernel, xiaoning.wang,
Frank.Li, lee
[-- Attachment #1: Type: text/plain, Size: 895 bytes --]
Hello Laurent,
On Mon, Aug 26, 2024 at 11:50:49AM +0300, Laurent Pinchart wrote:
> Thank you for the patch.
>
> On Mon, Aug 26, 2024 at 04:33:37PM +0800, Liu Ying wrote:
> > It turns out that OSC_EN bit in GERNERAL_CFG register has to be set to 1
> > when PWM state is enabled, otherwise PWM signal won't be generated.
>
> Indeed, this likely got lost during one of the reworks. The apply
> function correctly clears the bit when disabling PWM, but doesn't set it
> otherwise.
>
> > Fixes: e9b503879fd2 ("pwm: adp5585: Add Analog Devices ADP5585 support")
> > Signed-off-by: Liu Ying <victor.liu@nxp.com>
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
> Uwe, would you be able to queue this for v6.12 ?
Yes, I just merged Lee's immutable branch into my for-next branch to get
e9b503879fd2 and applied this patch on top.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-03 16:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-26 8:33 [PATCH] pwm: adp5585: Set OSC_EN bit to 1 when PWM state is enabled Liu Ying
2024-08-26 8:50 ` Laurent Pinchart
2024-09-03 16:20 ` 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