Commit 9f0f6107 authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Thierry Reding

pwm: cros-ec: Refuse requests with unsupported polarity

The driver only supports normal polarity and so should refuse requests
for inversed polarity.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent 09081c9b
...@@ -124,6 +124,9 @@ static int cros_ec_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm, ...@@ -124,6 +124,9 @@ static int cros_ec_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
if (state->period != EC_PWM_MAX_DUTY) if (state->period != EC_PWM_MAX_DUTY)
return -EINVAL; return -EINVAL;
if (state->polarity != PWM_POLARITY_NORMAL)
return -EINVAL;
/* /*
* EC doesn't separate the concept of duty cycle and enabled, but * EC doesn't separate the concept of duty cycle and enabled, but
* kernel does. Translate. * kernel does. Translate.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment