X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=drivers%2Fpwm%2Fpwm-meson.c;h=5cd7b90872c627e29fb409968df1513226cc5fb8;hb=1a8a804a4f5d6d0ec77831ca776b8db4a7a98306;hp=16d79ca5d8f5395d763432ad8f15801a54e5b113;hpb=d8763154455e92a2ffed256e48fa46bb35ef3bdf;p=tomoyo%2Ftomoyo-test1.git diff --git a/drivers/pwm/pwm-meson.c b/drivers/pwm/pwm-meson.c index 16d79ca5d8f5..5cd7b90872c6 100644 --- a/drivers/pwm/pwm-meson.c +++ b/drivers/pwm/pwm-meson.c @@ -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; }