Commit fed78ce4 authored by Shawn Guo's avatar Shawn Guo

tty: serial: imx: adopt pinctrl support

Cc: linux-serial@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarShawn Guo <shawn.guo@linaro.org>
Acked-by: default avatarDong Aisheng <dong.aisheng@linaro.org>
parent e62d8b8f
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/of_device.h> #include <linux/of_device.h>
#include <linux/pinctrl/consumer.h>
#include <asm/io.h> #include <asm/io.h>
#include <asm/irq.h> #include <asm/irq.h>
...@@ -1464,6 +1465,7 @@ static int serial_imx_probe(struct platform_device *pdev) ...@@ -1464,6 +1465,7 @@ static int serial_imx_probe(struct platform_device *pdev)
void __iomem *base; void __iomem *base;
int ret = 0; int ret = 0;
struct resource *res; struct resource *res;
struct pinctrl *pinctrl;
sport = kzalloc(sizeof(*sport), GFP_KERNEL); sport = kzalloc(sizeof(*sport), GFP_KERNEL);
if (!sport) if (!sport)
...@@ -1503,6 +1505,12 @@ static int serial_imx_probe(struct platform_device *pdev) ...@@ -1503,6 +1505,12 @@ static int serial_imx_probe(struct platform_device *pdev)
sport->timer.function = imx_timeout; sport->timer.function = imx_timeout;
sport->timer.data = (unsigned long)sport; sport->timer.data = (unsigned long)sport;
pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
if (IS_ERR(pinctrl)) {
ret = PTR_ERR(pinctrl);
goto unmap;
}
sport->clk = clk_get(&pdev->dev, "uart"); sport->clk = clk_get(&pdev->dev, "uart");
if (IS_ERR(sport->clk)) { if (IS_ERR(sport->clk)) {
ret = PTR_ERR(sport->clk); ret = PTR_ERR(sport->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