Commit 1112fe88 authored by Shawn Guo's avatar Shawn Guo Committed by Thierry Reding

pwm: pwm-mxs: add pinctrl support

Call pinctrl subsystem to set up pwm pin.
Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
Signed-off-by: default avatarThierry Reding <thierry.reding@avionic-design.de>
parent 22d260bd
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment