pwm: pwm-atmel-tcb: pinctrl support
Subsystems (2)
PATCH RESEND 1/1 pwm: pwm-atmel-tcb: pinctrl support
Setup tcb pins using pinctrl subsystem.
Signed-off-by Boris BREZILLON <[email protected]>
--- drivers/pwm/pwm-atmel-tcb.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/pwm/pwm-atmel-tcb.c +9 -0
@@ -21,6 +21,7 @@#include <linux/pwm.h> #include <linux/of_device.h> #include <linux/slab.h> +#include <linux/pinctrl/consumer.h> #define NPWM 6
@@ -365,6 +366,7 @@ static int atmel_tcb_pwm_probe(struct platform_device *pdev)struct atmel_tcb_pwm_chip *tcbpwm;struct device_node *np = pdev->dev.of_node;struct atmel_tc *tc; +struct pinctrl *pinctrl;int err;int tcblock;
@@ -389,6 +391,13 @@ static int atmel_tcb_pwm_probe(struct platform_device *pdev)return -ENOMEM ; } + pinctrl =devm_pinctrl_get_select_default (&pdev->dev); +if (IS_ERR (pinctrl)) { +atmel_tc_free (tc); +dev_err (&pdev->dev,"failed to get pinctrl config\n" ); +return PTR_ERR (pinctrl); + } + tcbpwm->chip.dev = &pdev->dev; tcbpwm->chip.ops = &atmel_tcb_pwm_ops; tcbpwm->chip.of_xlate = of_pwm_xlate_with_flags;
Signature · 1 line
1.7.9.5