summaryrefslogtreecommitdiff
path: root/drivers/pwm/pwm-meson.c
diff options
context:
space:
mode:
authorThierry Reding <thierry.reding@gmail.com>2023-03-23 14:49:21 +0100
committerThierry Reding <thierry.reding@gmail.com>2023-03-23 14:49:21 +0100
commit320bb07581ad6f889f30a6fcbed8e6f62d378e8f (patch)
treef5dddb574ebd830743af205b0ba19b913c742596 /drivers/pwm/pwm-meson.c
parentfe15c26ee26efa11741a7b632e9f23b01aca4cc6 (diff)
parent1271a7b98e7989ba6bb978e14403fc84efe16e13 (diff)
Merge branch 'fixes' into for-next
Diffstat (limited to 'drivers/pwm/pwm-meson.c')
-rw-r--r--drivers/pwm/pwm-meson.c8
1 files changed, 8 insertions, 0 deletions
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;
}