From mboxrd@z Thu Jan 1 00:00:00 1970 From: maxime.ripard@free-electrons.com (Maxime Ripard) Date: Wed, 19 Dec 2012 21:18:14 +0100 Subject: [PATCH 5/6] tty: of_serial: Add pinctrl support In-Reply-To: <1355948295-19680-1-git-send-email-maxime.ripard@free-electrons.com> References: <1355948295-19680-1-git-send-email-maxime.ripard@free-electrons.com> Message-ID: <1355948295-19680-6-git-send-email-maxime.ripard@free-electrons.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Use pinctrl to configure the SoCs pins directly from the driver. Signed-off-by: Maxime Ripard Cc: Alan Cox Cc: Greg Kroah-Hartman Cc: linux-serial at vger.kernel.org --- drivers/tty/serial/of_serial.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c index df443b9..f66bdab 100644 --- a/drivers/tty/serial/of_serial.c +++ b/drivers/tty/serial/of_serial.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -54,6 +55,7 @@ static int __devinit of_platform_serial_setup(struct platform_device *ofdev, int type, struct uart_port *port) { struct resource resource; + struct pinctrl *pinctrl; struct device_node *np = ofdev->dev.of_node; u32 clk, spd, prop; int ret; @@ -73,6 +75,11 @@ static int __devinit of_platform_serial_setup(struct platform_device *ofdev, return ret; } + pinctrl = devm_pinctrl_get_select_default(&ofdev->dev); + if (IS_ERR(pinctrl)) + dev_warn(&ofdev->dev, + "pins are not configured from the driver\n"); + spin_lock_init(&port->lock); port->mapbase = resource.start; -- 1.7.9.5