Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 019c088d authored by Clemens Gruber's avatar Clemens Gruber Committed by Greg Kroah-Hartman
Browse files

pwm: pca9685: Fix period change with same duty cycle



commit 8d254a340efb12b40c4c1ff25a48a4f48f7bbd6b upstream.

When first implementing support for changing the output frequency, an
optimization was added to continue the PWM after changing the prescaler
without having to reprogram the ON and OFF registers for the duty cycle,
in case the duty cycle stayed the same. This was flawed, because we
compared the absolute value of the duty cycle in nanoseconds instead of
the ratio to the period.

Fix the problem by removing the shortcut.

Fixes: 01ec8472 ("pwm-pca9685: Support changing the output frequency")
Signed-off-by: default avatarClemens Gruber <clemens.gruber@pqgruber.com>
Reviewed-by: default avatarMika Westerberg <mika.westerberg@linux.intel.com>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 1f2f16c7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment