]> git.baikalelectronics.ru Git - kernel.git/commit
pwm: bcm2835: Support apply function for atomic configuration
authorLino Sanfilippo <LinoSanfilippo@gmx.de>
Wed, 9 Dec 2020 20:48:25 +0000 (21:48 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Thu, 17 Dec 2020 13:19:01 +0000 (14:19 +0100)
commit96d077c06aff6106ecbe645a27a04482da91e6da
tree5639cebb9ceb430ff61425211ca88f61d6ab62cc
parentd977c4b22a27d6234a4a3c8fa4fe82f11fd744cd
pwm: bcm2835: Support apply function for atomic configuration

Use the newer .apply function of pwm_ops instead of .config, .enable,
.disable and .set_polarity. This guarantees atomic changes of the pwm
controller configuration. It also reduces the size of the driver.

Since now period is a 64 bit value, add an extra check to reject periods
that exceed the possible max value for the 32 bit register.

This has been tested on a Raspberry PI 4.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-bcm2835.c