mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Arnd Bergmann <arnd@arndb.de>, Olof Johansson <olof@lixom.net>,
	Linus Walleij <linus.walleij@linaro.org>
Cc: Stefan Roese <sr@denx.de>, Alejandro Mery <amery@geeks.cl>,
	linux-arm-kernel@lists.infradead.org,
	Alan Cox <alan@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.cz>,
	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	[thread overview]
Message-ID: <1358544639-14761-7-git-send-email-maxime.ripard@free-electrons.com> (raw)
In-Reply-To: <1358544639-14761-1-git-send-email-maxime.ripard@free-electrons.com>

Use pinctrl to configure the SoCs pins directly from the driver.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 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 <linux/module.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
+#include <linux/pinctrl/consumer.h>
 #include <linux/serial_core.h>
 #include <linux/serial_8250.h>
 #include <linux/serial_reg.h>
@@ -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


  parent reply	other threads:[~2013-01-18 21:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1358544639-14761-1-git-send-email-maxime.ripard@free-electrons.com>
2013-01-18 21:30 ` [PATCH 1/7] pinctrl: pinconf-generic: add drive strength parameter Maxime Ripard
2013-01-21 22:05   ` Linus Walleij
2013-01-18 21:30 ` [PATCH 2/7] ARM: sunxi: Add pinctrl driver for Allwinner SoCs Maxime Ripard
2013-01-21 22:09   ` Linus Walleij
2013-01-22  8:09     ` Olof Johansson
2013-01-21 22:28   ` Arnd Bergmann
2013-01-18 21:30 ` [PATCH 3/7] ARM: pinctrl: sunxi: Add the pinctrl pin set for sun5i Maxime Ripard
2013-01-18 21:30 ` [PATCH 4/7] ARM: sunxi: Add pinctrl node to the device tree Maxime Ripard
2013-01-18 21:30 ` [PATCH 5/7] ARM: sunxi: Add uart1 pinctrl groups Maxime Ripard
2013-01-18 21:30 ` Maxime Ripard [this message]
2013-01-21 22:13   ` [PATCH 6/7] tty: of_serial: Add pinctrl support Linus Walleij
2013-01-21 23:42     ` Greg Kroah-Hartman
2013-01-18 21:30 ` [PATCH 7/7] ARM: sunxi: olinuxino: Add muxing for the uart Maxime Ripard
2013-01-21 22:15   ` Linus Walleij
2013-01-22  7:17     ` Olof Johansson
     [not found] <1357681398-23956-1-git-send-email-maxime.ripard@free-electrons.com>
2013-01-08 21:43 ` [PATCH 6/7] tty: of_serial: Add pinctrl support Maxime Ripard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1358544639-14761-7-git-send-email-maxime.ripard@free-electrons.com \
    --to=maxime.ripard@free-electrons.com \
    --cc=alan@linux.intel.com \
    --cc=amery@geeks.cl \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.cz \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=olof@lixom.net \
    --cc=sr@denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®