diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-06-26 12:58:11 +0400 |
---|---|---|
committer | Thierry Reding <thierry.reding@avionic-design.de> | 2012-07-23 15:23:56 +0400 |
commit | 1112fe88d4ebbb5f46750726b87fb0beb1396835 (patch) | |
tree | da8c4f940f2f753e521e6cd0610b50419b82814e /drivers/pwm/pwm-mxs.c | |
parent | 22d260bd88452ae81c80514810434d4cc98b7978 (diff) | |
download | linux-1112fe88d4ebbb5f46750726b87fb0beb1396835.tar.xz |
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>
Diffstat (limited to 'drivers/pwm/pwm-mxs.c')
-rw-r--r-- | drivers/pwm/pwm-mxs.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/pwm/pwm-mxs.c b/drivers/pwm/pwm-mxs.c index 3b7f3ab116e3..269d7c2a87d6 100644 --- a/drivers/pwm/pwm-mxs.c +++ b/drivers/pwm/pwm-mxs.c @@ -16,6 +16,7 @@ #include <linux/module.h> #include <linux/of.h> #include <linux/of_address.h> +#include <linux/pinctrl/consumer.h> #include <linux/platform_device.h> #include <linux/pwm.h> #include <linux/slab.h> @@ -130,6 +131,7 @@ static int mxs_pwm_probe(struct platform_device *pdev) struct device_node *np = pdev->dev.of_node; struct mxs_pwm_chip *mxs; struct resource *res; + struct pinctrl *pinctrl; int ret; mxs = devm_kzalloc(&pdev->dev, sizeof(*mxs), GFP_KERNEL); @@ -141,6 +143,10 @@ static int mxs_pwm_probe(struct platform_device *pdev) if (!mxs->base) return -EADDRNOTAVAIL; + pinctrl = devm_pinctrl_get_select_default(&pdev->dev); + if (IS_ERR(pinctrl)) + return PTR_ERR(pinctrl); + mxs->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(mxs->clk)) return PTR_ERR(mxs->clk); |