diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-06-26 04:58:11 -0400 |
---|---|---|
committer | Thierry Reding <thierry.reding@avionic-design.de> | 2012-07-23 07:23:56 -0400 |
commit | 1112fe88d4ebbb5f46750726b87fb0beb1396835 (patch) | |
tree | da8c4f940f2f753e521e6cd0610b50419b82814e /drivers/pwm | |
parent | 22d260bd88452ae81c80514810434d4cc98b7978 (diff) |
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')
-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 @@ | |||
16 | #include <linux/module.h> | 16 | #include <linux/module.h> |
17 | #include <linux/of.h> | 17 | #include <linux/of.h> |
18 | #include <linux/of_address.h> | 18 | #include <linux/of_address.h> |
19 | #include <linux/pinctrl/consumer.h> | ||
19 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
20 | #include <linux/pwm.h> | 21 | #include <linux/pwm.h> |
21 | #include <linux/slab.h> | 22 | #include <linux/slab.h> |
@@ -130,6 +131,7 @@ static int mxs_pwm_probe(struct platform_device *pdev) | |||
130 | struct device_node *np = pdev->dev.of_node; | 131 | struct device_node *np = pdev->dev.of_node; |
131 | struct mxs_pwm_chip *mxs; | 132 | struct mxs_pwm_chip *mxs; |
132 | struct resource *res; | 133 | struct resource *res; |
134 | struct pinctrl *pinctrl; | ||
133 | int ret; | 135 | int ret; |
134 | 136 | ||
135 | mxs = devm_kzalloc(&pdev->dev, sizeof(*mxs), GFP_KERNEL); | 137 | mxs = devm_kzalloc(&pdev->dev, sizeof(*mxs), GFP_KERNEL); |
@@ -141,6 +143,10 @@ static int mxs_pwm_probe(struct platform_device *pdev) | |||
141 | if (!mxs->base) | 143 | if (!mxs->base) |
142 | return -EADDRNOTAVAIL; | 144 | return -EADDRNOTAVAIL; |
143 | 145 | ||
146 | pinctrl = devm_pinctrl_get_select_default(&pdev->dev); | ||
147 | if (IS_ERR(pinctrl)) | ||
148 | return PTR_ERR(pinctrl); | ||
149 | |||
144 | mxs->clk = devm_clk_get(&pdev->dev, NULL); | 150 | mxs->clk = devm_clk_get(&pdev->dev, NULL); |
145 | if (IS_ERR(mxs->clk)) | 151 | if (IS_ERR(mxs->clk)) |
146 | return PTR_ERR(mxs->clk); | 152 | return PTR_ERR(mxs->clk); |