Commit 3db9b76d7b6aa6eee1f9be83cf807e531e74bf4f

Authored by Philip, Avinash
Committed by Thierry Reding
1 parent 333b08ee8c

pwm: pwm-tiecap: pinctrl support

Enable pinctrl for pwm-tiecap if pinctrl driver available, else
bail out with warning message.

Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>

Showing 1 changed file with 6 additions and 0 deletions Side-by-side Diff

drivers/pwm/pwm-tiecap.c
... ... @@ -26,6 +26,7 @@
26 26 #include <linux/pm_runtime.h>
27 27 #include <linux/pwm.h>
28 28 #include <linux/of_device.h>
  29 +#include <linux/pinctrl/consumer.h>
29 30  
30 31 #include "pwm-tipwmss.h"
31 32  
... ... @@ -200,6 +201,11 @@
200 201 struct clk *clk;
201 202 struct ecap_pwm_chip *pc;
202 203 u16 status;
  204 + struct pinctrl *pinctrl;
  205 +
  206 + pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
  207 + if (IS_ERR(pinctrl))
  208 + dev_warn(&pdev->dev, "unable to select pin group\n");
203 209  
204 210 pc = devm_kzalloc(&pdev->dev, sizeof(*pc), GFP_KERNEL);
205 211 if (!pc) {