[PATCH v4] pwm: bcm2835: Support apply function for atomic configuration

Thierry Reding thierry.reding at gmail.com
Thu Dec 10 12:21:22 EST 2020


On Wed, Dec 09, 2020 at 09:48:25PM +0100, Lino Sanfilippo wrote:
> 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 at gmx.de>
> ---
> 
> v4: Remove a superfluous blank line
>     Remove an unneeded cast (both requested by Uwe Kleine-König)
> v3: Check against period truncation (also based on a review by Uwe)
> v2: Fix compiler error for 64 bit builds
> 
>  drivers/pwm/pwm-bcm2835.c | 69 +++++++++++++++++------------------------------
>  1 file changed, 24 insertions(+), 45 deletions(-) j

Applied, thanks.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20201210/ef4d4d4c/attachment.sig>


More information about the linux-arm-kernel mailing list