aboutsummaryrefslogtreecommitdiff
path: root/drivers/pwm
diff options
context:
space:
mode:
authorUwe Kleine-König2021-03-12 09:59:16 +0100
committerThierry Reding2021-03-22 12:07:26 +0100
commit09081c9ba6c22bd63b6ce681e60d71a95acbc115 (patch)
tree7bddf10dee9da89fad4e30e793e383841c1ef53e /drivers/pwm
parentc77e99f434c29d79505bd740cfead9648dfe0795 (diff)
pwm: sprd: 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: Chunyan Zhang <zhang.lyra@gmail.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm')
-rw-r--r--drivers/pwm/pwm-sprd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/pwm/pwm-sprd.c b/drivers/pwm/pwm-sprd.c
index 108cbec88667..98c479dfae31 100644
--- a/drivers/pwm/pwm-sprd.c
+++ b/drivers/pwm/pwm-sprd.c
@@ -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) {
/*