pwm: Assume a disabled PWM to emit a constant inactive output
authorUwe Kleine-König <u.kleine-koenig@baylibre.com>
Tue, 5 Nov 2024 15:35:22 +0000 (16:35 +0100)
committerUwe Kleine-König <ukleinek@kernel.org>
Thu, 7 Nov 2024 11:03:39 +0000 (12:03 +0100)
commitb2eaa1170e45dc18eb09dcc9abafbe9a7502e960
treee228ed35fefeb29c9aa90f71e4bb20db2d1e2da1
parent2ea25aab938a250bdf3148acd15359b56b91b40e
pwm: Assume a disabled PWM to emit a constant inactive output

Some PWM hardwares (e.g. MC33XS2410) cannot implement a zero duty cycle
but can instead disable the hardware which also results in a constant
inactive output.

There are some checks (enabled with CONFIG_PWM_DEBUG) to help
implementing a driver without violating the normal rounding rules. Make
them less strict to let above described hardware pass without warning.

Reported-by: Dimitri Fedrau <dima.fedrau@gmail.com>
Link: https://lore.kernel.org/r/20241103205215.GA509903@debian
Fixes: 3ad1f3a33286 ("pwm: Implement some checks for lowlevel drivers")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Reviewed-by: Dimitri Fedrau <dima.fedrau@gmail.com>
Tested-by: Dimitri Fedrau <dima.fedrau@gmail.com>
Link: https://lore.kernel.org/r/20241105153521.1001864-2-u.kleine-koenig@baylibre.com
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
drivers/pwm/core.c