Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pwm: pwm-mxs: add pinctrl support

Call pinctrl subsystem to set up pwm pin.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>

authored by

Shawn Guo and committed by
Thierry Reding
1112fe88 22d260bd

+6
+6
drivers/pwm/pwm-mxs.c
··· 16 16 #include <linux/module.h> 17 17 #include <linux/of.h> 18 18 #include <linux/of_address.h> 19 + #include <linux/pinctrl/consumer.h> 19 20 #include <linux/platform_device.h> 20 21 #include <linux/pwm.h> 21 22 #include <linux/slab.h> ··· 131 130 struct device_node *np = pdev->dev.of_node; 132 131 struct mxs_pwm_chip *mxs; 133 132 struct resource *res; 133 + struct pinctrl *pinctrl; 134 134 int ret; 135 135 136 136 mxs = devm_kzalloc(&pdev->dev, sizeof(*mxs), GFP_KERNEL); ··· 142 140 mxs->base = devm_request_and_ioremap(&pdev->dev, res); 143 141 if (!mxs->base) 144 142 return -EADDRNOTAVAIL; 143 + 144 + pinctrl = devm_pinctrl_get_select_default(&pdev->dev); 145 + if (IS_ERR(pinctrl)) 146 + return PTR_ERR(pinctrl); 145 147 146 148 mxs->clk = devm_clk_get(&pdev->dev, NULL); 147 149 if (IS_ERR(mxs->clk))