Skip to content

Commit 3ecb101

Browse files
Uwe Kleine-Königbrgl
authored andcommitted
gpio: mvebu/pwm: Refuse requests with inverted polarity
The driver doesn't take struct pwm_state::polarity into account when configuring the hardware, so refuse requests for inverted polarity. Fixes: 757642f ("gpio: mvebu: Add limited PWM support") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
1 parent 9bf3ac4 commit 3ecb101

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/gpio/gpio-mvebu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,9 @@ static int mvebu_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
707707
unsigned long flags;
708708
unsigned int on, off;
709709

710+
if (state->polarity != PWM_POLARITY_NORMAL)
711+
return -EINVAL;
712+
710713
val = (unsigned long long) mvpwm->clk_rate * state->duty_cycle;
711714
do_div(val, NSEC_PER_SEC);
712715
if (val > UINT_MAX + 1ULL)

0 commit comments

Comments
 (0)