Revert "Revert "pwm: meson: Explicitly set .polarity in .get_state()""
This reverts commit af88eb49be.
It was perserving the ABI, but that is not needed anymore at this point
in time.
Change-Id: Iaf8c7af434912fc219d411c8c9b17292f1605af5
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
0dff4eccbe
commit
019fe14f01
1 changed files with 8 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue