[PATCH] pwm: imx27: workaround of the pwm output bug

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Wed Jan 3 04:18:14 PST 2024


On Wed, Jan 03, 2024 at 11:34:21AM +0100, Francesco Dolcini wrote:
> On Fri, Dec 29, 2023 at 12:00:07PM +0530, pratikmanvar09 at gmail.com wrote:
> > From: Clark Wang <xiaoning.wang at nxp.com>
> > 
> > This fixes the pwm output bug when decrease the duty cycle.
> > This is a limited workaround for the PWM IP issue TKT0577206.
> > 
> > Root cause:
> > When the SAR FIFO is empty, the new write value will be directly applied
> > to SAR even the current period is not over.
> > If the new SAR value is less than the old one, and the counter is
> > greater than the new SAR value, the current period will not filp the
> > level. This will result in a pulse with a duty cycle of 100%.
> > 
> > Workaround:
> > Add an old value SAR write before updating the new duty cycle to SAR.
> > This will keep the new value is always in a not empty fifo, and can be
> > wait to update after a period finished.
> > 
> > Limitation:
> > This workaround can only solve this issue when the PWM period is longer
> > than 2us(or <500KHz).
> > 
> > Reviewed-by: Jun Li <jun.li at nxp.com>
> > Signed-off-by: Clark Wang <xiaoning.wang at nxp.com>
> > Link: https://github.com/nxp-imx/linux-imx/commit/16181cc4eee61d87cbaba0e5a479990507816317
> > Tested-by: Pratik Manvar <pratik.manvar at ifm.com>
> 
> You need to add your signed-off-by at the end when sending a patch, no
> matter if you are the author or not.

FTR: This also applies to the v2 patch. I discarded both from the pwm
patchwork.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20240103/e65e484a/attachment.sig>


More information about the linux-arm-kernel mailing list