From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756098Ab3ARVba (ORCPT ); Fri, 18 Jan 2013 16:31:30 -0500 Received: from mail.free-electrons.com ([94.23.35.102]:47088 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751815Ab3ARVaz (ORCPT ); Fri, 18 Jan 2013 16:30:55 -0500 From: Maxime Ripard To: Arnd Bergmann , Olof Johansson , Linus Walleij Cc: Stefan Roese , Alejandro Mery , linux-arm-kernel@lists.infradead.org, Alan Cox , Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 6/7] tty: of_serial: Add pinctrl support Date: Fri, 18 Jan 2013 22:30:38 +0100 Message-Id: <1358544639-14761-7-git-send-email-maxime.ripard@free-electrons.com> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1358544639-14761-1-git-send-email-maxime.ripard@free-electrons.com> References: <1358544639-14761-1-git-send-email-maxime.ripard@free-electrons.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use pinctrl to configure the SoCs pins directly from the driver. Signed-off-by: Maxime Ripard --- 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 e7cae1c..e9f3289 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 @@ -57,6 +58,7 @@ static int of_platform_serial_setup(struct platform_device *ofdev, struct of_serial_info *info) { struct resource resource; + struct pinctrl *pinctrl; struct device_node *np = ofdev->dev.of_node; u32 clk, spd, prop; int ret; @@ -85,6 +87,11 @@ static int of_platform_serial_setup(struct platform_device *ofdev, goto out; } + 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.10.4