[PATCH] pwm: atmel: Fix duty cycle calculation in .get_state()

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Mon Apr 19 20:29:08 BST 2021


Hello,

On Sun, Apr 18, 2021 at 10:57:47PM +0200, Uwe Kleine-König wrote:
> -		tmp = (u64)cdty * NSEC_PER_SEC;
> +		tmp = (u64)(cdty - cprd) * NSEC_PER_SEC;

This is wrong, it must be cprd - cdty. I will send a fixed patch
together with another patch that improves precision of _apply.

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/20210419/8d350d7d/attachment.sig>


More information about the linux-arm-kernel mailing list