pwm: Make it possible to apply PWM changes in atomic context
authorSean Young <sean@mess.org>
Tue, 19 Dec 2023 16:30:27 +0000 (16:30 +0000)
committerThierry Reding <thierry.reding@gmail.com>
Wed, 20 Dec 2023 15:07:06 +0000 (16:07 +0100)
commit7170d3beafc2373dd76b6b5d6e617d89e4e42b8b
tree0c5b06c6031df723f752de7120acf85a915c458a
parent752193da3f8b0aa819a27fc741d46ab046be315e
pwm: Make it possible to apply PWM changes in atomic context

Some PWM devices require sleeping, for example if the pwm device is
connected over I2C. However, many PWM devices could be used from atomic
context, e.g. memory mapped PWM. This is useful for, for example, the
pwm-ir-tx driver which requires precise timing. Sleeping causes havoc
with the generated IR signal.

Since not all PWM devices can support atomic context, we also add a
pwm_might_sleep() function to check if is not supported.

Signed-off-by: Sean Young <sean@mess.org>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Documentation/driver-api/pwm.rst
MAINTAINERS
drivers/pwm/core.c
include/linux/pwm.h