]> git.baikalelectronics.ru Git - kernel.git/commit
gpio: mvebu: fix pwm .get_state period calculation
authorBaruch Siach <baruch@tkos.co.il>
Sun, 17 Jan 2021 13:17:02 +0000 (15:17 +0200)
committerBartosz Golaszewski <bgolaszewski@baylibre.com>
Tue, 19 Jan 2021 10:58:22 +0000 (11:58 +0100)
commit87640cb630c4c04175aa305a70acd82f1e6b0347
treef83b2e8f9fe0d35e1e9c2dc4278e5b0c757ad7fa
parent0ed6d8df0508a9c165c05c9984637ca1421d4947
gpio: mvebu: fix pwm .get_state period calculation

The period is the sum of on and off values. That is, calculate period as

  ($on + $off) / clkrate

instead of

  $off / clkrate - $on / clkrate

that makes no sense.

Reported-by: Russell King <linux@armlinux.org.uk>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fixes: 1c81948016b37 ("gpio: mvebu: Add limited PWM support")
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
drivers/gpio/gpio-mvebu.c