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: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
This commit is contained in:
parent
09081c9ba6
commit
9f0f6107e0
@ -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)
|
||||
return -EINVAL;
|
||||
|
||||
if (state->polarity != PWM_POLARITY_NORMAL)
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* EC doesn't separate the concept of duty cycle and enabled, but
|
||||
* kernel does. Translate.
|
||||
|
Loading…
Reference in New Issue
Block a user