mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
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
1 changed files with 3 additions and 0 deletions
|
@ -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…
Add table
Reference in a new issue