Commit 09081c9b authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Thierry Reding

pwm: sprd: 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 avatarChunyan Zhang <zhang.lyra@gmail.com>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent c77e99f4
......@@ -164,6 +164,9 @@ static int sprd_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
struct pwm_state *cstate = &pwm->state;
int ret;
if (state->polarity != PWM_POLARITY_NORMAL)
return -EINVAL;
if (state->enabled) {
if (!cstate->enabled) {
/*
......
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