]> git.itanic.dy.fi Git - linux-stable/commitdiff
pwm: lpc18xx-sct: Don't modify the cached period of other PWM outputs
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Sat, 9 Dec 2023 23:00:46 +0000 (00:00 +0100)
committerThierry Reding <thierry.reding@gmail.com>
Wed, 20 Dec 2023 16:01:43 +0000 (17:01 +0100)
Even though the hardware only supports a single period for all PWM
outputs, modifying the other (disabled) outputs's period is strange and
wrong. Only the pwm core is supposed to update these values.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-lpc18xx-sct.c

index b3d4a955aa3119eb3483197bfd44a844a41cb02d..fe891fa71a1ddc7fd50ac7cd444cce53aa35ebff 100644 (file)
@@ -194,7 +194,7 @@ static int lpc18xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
                              int duty_ns, int period_ns)
 {
        struct lpc18xx_pwm_chip *lpc18xx_pwm = to_lpc18xx_pwm_chip(chip);
-       int requested_events, i;
+       int requested_events;
 
        if (period_ns < lpc18xx_pwm->min_period_ns ||
            period_ns > lpc18xx_pwm->max_period_ns) {
@@ -223,8 +223,6 @@ static int lpc18xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
        if ((requested_events <= 2 && lpc18xx_pwm->period_ns != period_ns) ||
            !lpc18xx_pwm->period_ns) {
                lpc18xx_pwm->period_ns = period_ns;
-               for (i = 0; i < chip->npwm; i++)
-                       pwm_set_period(&chip->pwms[i], period_ns);
                lpc18xx_pwm_config_period(chip, period_ns);
        }