From: maxime.ripard@free-electrons.com (Maxime Ripard)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/6] tty: of_serial: Add pinctrl support
Date: Wed, 19 Dec 2012 21:18:14 +0100 [thread overview]
Message-ID: <1355948295-19680-6-git-send-email-maxime.ripard@free-electrons.com> (raw)
In-Reply-To: <1355948295-19680-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>
Cc: Alan Cox <alan@linux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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 <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>
@@ -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
next prev parent reply other threads:[~2012-12-19 20:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-19 20:18 [PATCHv2 0/6] Add pinctrl driver for Allwinner A1X SoCs Maxime Ripard
2012-12-19 20:18 ` [PATCH 1/6] ARM: sunxi: Add pinctrl driver for Allwinner SoCs Maxime Ripard
2013-01-06 23:46 ` Linus Walleij
2013-01-07 15:50 ` Maxime Ripard
2013-01-17 9:55 ` Linus Walleij
2012-12-19 20:18 ` [PATCH 2/6] ARM: pinctrl: sunxi: Add the pinctrl pin set for sun5i Maxime Ripard
2012-12-19 20:18 ` [PATCH 3/6] ARM: sunxi: Add pinctrl node to the device tree Maxime Ripard
2012-12-19 20:18 ` [PATCH 4/6] ARM: sunxi: Add uart1 pinctrl groups Maxime Ripard
2012-12-19 20:18 ` Maxime Ripard [this message]
2012-12-19 20:18 ` [PATCH 6/6] ARM: sunxi: olinuxino: Add muxing for the uart Maxime Ripard
-- strict thread matches above, loose matches on Subject: below --
2012-12-10 22:08 [PATCH 0/6] Add pinctrl driver for Allwinner A1X SoCs Maxime Ripard
2012-12-10 22:08 ` [PATCH 5/6] 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=1355948295-19680-6-git-send-email-maxime.ripard@free-electrons.com \
--to=maxime.ripard@free-electrons.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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