summaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-pxa.c
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2021-10-25 10:09:23 -0700
committerRobert Foss <robert.foss@linaro.org>2021-10-27 17:02:33 +0200
commit3ab7b6ac5d829e60c3b89d415811ff1c9f358c8e (patch)
tree74d922d811a868dac6cc67c92a3e038920089354 /drivers/pwm/pwm-pxa.c
parent086b90c76fc18246b03aaf728d2f30a1a018a1b4 (diff)
downloadlinux-stable-3ab7b6ac5d829e60c3b89d415811ff1c9f358c8e.tar.gz
linux-stable-3ab7b6ac5d829e60c3b89d415811ff1c9f358c8e.tar.bz2
linux-stable-3ab7b6ac5d829e60c3b89d415811ff1c9f358c8e.zip
pwm: Introduce single-PWM of_xlate function
The existing pxa driver and the upcoming addition of PWM support in the TI sn565dsi86 DSI/eDP bridge driver both has a single PWM channel and thereby a need for a of_xlate function with the period as its single argument. Introduce a common helper function in the core that can be used as of_xlate by such drivers and migrate the pxa driver to use this. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Tested-by: Steev Klimaszewski <steev@kali.org> Tested-By: Steev Klimaszewski <steev@kali.org> Signed-off-by: Robert Foss <robert.foss@linaro.org> Link: https://patchwork.freedesktop.org/patch/msgid/20211025170925.3096444-1-bjorn.andersson@linaro.org
Diffstat (limited to 'drivers/pwm/pwm-pxa.c')
-rw-r--r--drivers/pwm/pwm-pxa.c16
1 files changed, 1 insertions, 15 deletions
diff --git a/drivers/pwm/pwm-pxa.c b/drivers/pwm/pwm-pxa.c
index a9efdcf839ae..238ec88c130b 100644
--- a/drivers/pwm/pwm-pxa.c
+++ b/drivers/pwm/pwm-pxa.c
@@ -148,20 +148,6 @@ static const struct platform_device_id *pxa_pwm_get_id_dt(struct device *dev)
return id ? id->data : NULL;
}
-static struct pwm_device *
-pxa_pwm_of_xlate(struct pwm_chip *pc, const struct of_phandle_args *args)
-{
- struct pwm_device *pwm;
-
- pwm = pwm_request_from_chip(pc, 0, NULL);
- if (IS_ERR(pwm))
- return pwm;
-
- pwm->args.period = args->args[0];
-
- return pwm;
-}
-
static int pwm_probe(struct platform_device *pdev)
{
const struct platform_device_id *id = platform_get_device_id(pdev);
@@ -187,7 +173,7 @@ static int pwm_probe(struct platform_device *pdev)
pc->chip.npwm = (id->driver_data & HAS_SECONDARY_PWM) ? 2 : 1;
if (IS_ENABLED(CONFIG_OF)) {
- pc->chip.of_xlate = pxa_pwm_of_xlate;
+ pc->chip.of_xlate = of_pwm_single_xlate;
pc->chip.of_pwm_n_cells = 1;
}