Commit 471c2500 authored by Clemens Gruber's avatar Clemens Gruber Committed by Greg Kroah-Hartman
Browse files

pwm: pca9685: Restrict period change for enabled PWMs



[ Upstream commit 6d6e7050 ]

Previously, the last used PWM channel could change the global prescale
setting, even if other channels are already in use.

Fix it by only allowing the first enabled PWM to change the global
chip-wide prescale setting. If there is more than one channel in use,
the prescale settings resulting from the chosen periods must match.

GPIOs do not count as enabled PWMs as they are not using the prescaler
and can't change it.

Signed-off-by: default avatarClemens Gruber <clemens.gruber@pqgruber.com>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b050025f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment