[PATCH v5 4/4] gpio: mvebu: improve handling of pwm zero on/off values

Uwe Kleine-König u.kleine-koenig at pengutronix.de
Wed Jan 20 12:24:49 EST 2021


On Wed, Jan 20, 2021 at 06:16:28PM +0200, Baruch Siach wrote:
> Hardware appears to treat zero value as 2^32. Take advantage of this
> fact to support on/off values of up to UINT_MAX+1 == 2^32. Adjust both
> .apply and .get_state to handle zero as a special case.
> 
> Rounded up division result in .get_state can't be zero, since the
> dividend is now larger than 0. Remove check for this case.
> 
> Reported-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>
> Analyzed-by: Russell King <linux at armlinux.org.uk>
> Signed-off-by: Baruch Siach <baruch at tkos.co.il>

Reviewed-by: Uwe Kleine-König <u.kleine-koenig at pengutronix.de>

Thanks
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/20210120/1854922c/attachment.sig>


More information about the linux-arm-kernel mailing list