From f9a8ee8c8bcd118e800d88772c6457381db45224 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Mon, 1 Mar 2021 19:57:19 +0100 Subject: pwm: Always allocate PWM chip base ID dynamically MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since commit 5e5da1e9fbee ("pwm: ab8500: Explicitly allocate pwm chip base dynamically") all drivers use dynamic ID allocation explicitly. New drivers are supposed to do the same, so remove support for driver specified base IDs and drop all assignments in the low-level drivers. Signed-off-by: Uwe Kleine-König Signed-off-by: Thierry Reding --- drivers/pwm/pwm-sprd.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/pwm/pwm-sprd.c') diff --git a/drivers/pwm/pwm-sprd.c b/drivers/pwm/pwm-sprd.c index 5123d948efd6..108cbec88667 100644 --- a/drivers/pwm/pwm-sprd.c +++ b/drivers/pwm/pwm-sprd.c @@ -268,7 +268,6 @@ static int sprd_pwm_probe(struct platform_device *pdev) spc->chip.dev = &pdev->dev; spc->chip.ops = &sprd_pwm_ops; - spc->chip.base = -1; spc->chip.npwm = spc->num_pwms; ret = pwmchip_add(&spc->chip); -- cgit v1.2.3 From 09081c9ba6c22bd63b6ce681e60d71a95acbc115 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Fri, 12 Mar 2021 09:59:16 +0100 Subject: pwm: sprd: Refuse requests with unsupported polarity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The driver only supports normal polarity and so should refuse requests for inversed polarity. Signed-off-by: Uwe Kleine-König Acked-by: Chunyan Zhang Signed-off-by: Thierry Reding --- drivers/pwm/pwm-sprd.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/pwm/pwm-sprd.c') 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) { /* -- cgit v1.2.3