pwm: meson: Don't disable PWM when setting duty repeatedly
authorBichao Zheng <bichao.zheng@amlogic.com>
Mon, 1 Apr 2019 18:18:17 +0000 (20:18 +0200)
committerThierry Reding <thierry.reding@gmail.com>
Thu, 9 May 2019 14:50:35 +0000 (16:50 +0200)
There is an abnormally low about 20ms,when setting duty repeatedly.
Because setting the duty will disable PWM and then enable. Delete
this operation now.

Fixes: 211ed630753d2f ("pwm: Add support for Meson PWM Controller")
Signed-off-by: Bichao Zheng <bichao.zheng@amlogic.com>
[ Dropped code instead of hiding it behind a comment ]
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
drivers/pwm/pwm-meson.c

index aaae48ab484ef0069c6b0bf957ef7fb7ab07df9d..2ab3d216b35a71db6cd115630a1882d3b11fd5e7 100644 (file)
@@ -314,11 +314,6 @@ static int meson_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
        if (state->period != channel->state.period ||
            state->duty_cycle != channel->state.duty_cycle ||
            state->polarity != channel->state.polarity) {
-               if (channel->state.enabled) {
-                       meson_pwm_disable(meson, pwm->hwpwm);
-                       channel->state.enabled = false;
-               }
-
                if (state->polarity != channel->state.polarity) {
                        if (state->polarity == PWM_POLARITY_NORMAL)
                                meson->inverter_mask |= BIT(pwm->hwpwm);