Skip to content
Commit 0b68d02b authored by Baruch Siach's avatar Baruch Siach Committed by Bartosz Golaszewski
Browse files

gpio: mvebu: improve handling of pwm zero on/off values



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: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Analyzed-by: default avatarRussell King <linux@armlinux.org.uk>
Signed-off-by: default avatarBaruch Siach <baruch@tkos.co.il>
Reviewed-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
parent 2bee255a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment