OSDN Git Service

Merge tag 'trace-v6.3-rc5-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[tomoyo/tomoyo-test1.git] / drivers / pwm / pwm-meson.c
index 16d79ca..5cd7b90 100644 (file)
@@ -162,6 +162,12 @@ static int meson_pwm_calc(struct meson_pwm *meson, struct pwm_device *pwm,
        duty = state->duty_cycle;
        period = state->period;
 
+       /*
+        * Note this is wrong. The result is an output wave that isn't really
+        * inverted and so is wrongly identified by .get_state as normal.
+        * Fixing this needs some care however as some machines might rely on
+        * this.
+        */
        if (state->polarity == PWM_POLARITY_INVERSED)
                duty = period - duty;
 
@@ -358,6 +364,8 @@ static int meson_pwm_get_state(struct pwm_chip *chip, struct pwm_device *pwm,
                state->duty_cycle = 0;
        }
 
+       state->polarity = PWM_POLARITY_NORMAL;
+
        return 0;
 }