Commit 6ef213d6 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 8d254a34 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 e1c924e8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment