From: haojian.zhuang@linaro.org (Haojian Zhuang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 6/8] tty: pxa: configure pin
Date: Fri, 21 Dec 2012 17:45:16 +0800 [thread overview]
Message-ID: <1356083118-18857-7-git-send-email-haojian.zhuang@linaro.org> (raw)
In-Reply-To: <1356083118-18857-1-git-send-email-haojian.zhuang@linaro.org>
From: Haojian Zhuang <haojian.zhuang@gmail.com>
Configure pins by pinctrl driver.
Signed-off-by: Haojian Zhuang <haojian.zhuang@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
---
drivers/tty/serial/pxa.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
index 2764828..4492c1d 100644
--- a/drivers/tty/serial/pxa.c
+++ b/drivers/tty/serial/pxa.c
@@ -37,6 +37,7 @@
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/of.h>
+#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
@@ -864,6 +865,7 @@ static int serial_pxa_probe_dt(struct platform_device *pdev,
struct uart_pxa_port *sport)
{
struct device_node *np = pdev->dev.of_node;
+ struct pinctrl *pinctrl;
int ret;
if (!np)
@@ -874,6 +876,10 @@ static int serial_pxa_probe_dt(struct platform_device *pdev,
dev_err(&pdev->dev, "failed to get alias id, errno %d\n", ret);
return ret;
}
+ pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+ if (IS_ERR(pinctrl))
+ return -EPROBE_DEFER;
+
sport->port.line = ret;
return 0;
}
@@ -912,7 +918,7 @@ static int serial_pxa_probe(struct platform_device *dev)
ret = serial_pxa_probe_dt(dev, sport);
if (ret > 0)
sport->port.line = dev->id;
- else if (ret < 0)
+ if (ret < 0)
goto err_clk;
snprintf(sport->name, PXA_NAME_LEN - 1, "UART%d", sport->port.line + 1);
--
1.7.10.4
next prev parent reply other threads:[~2012-12-21 9:45 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-21 9:45 [PATCH v6 0/8] pinctrl: support mmp silicon with single driver Haojian Zhuang
2012-12-21 9:45 ` [PATCH v6 1/8] pinctrl: single: support generic pinconf Haojian Zhuang
2012-12-22 1:24 ` Tony Lindgren
2013-01-04 0:14 ` Tony Lindgren
2012-12-21 9:45 ` [PATCH v6 2/8] ARM: dts: support pinctrl single in pxa910 Haojian Zhuang
2013-01-04 0:17 ` Tony Lindgren
2012-12-21 9:45 ` [PATCH v6 3/8] ARM: dts: support pinctrl single in aspenite Haojian Zhuang
2012-12-21 9:45 ` [PATCH v6 4/8] ARM: dts: support pinctrl single in brownstone Haojian Zhuang
2012-12-21 9:45 ` [PATCH v6 5/8] document: devicetree: bind pinconf with pin single Haojian Zhuang
2012-12-22 1:22 ` Tony Lindgren
2012-12-22 6:33 ` Haojian Zhuang
2012-12-22 17:07 ` Tony Lindgren
2013-01-04 0:25 ` Tony Lindgren
2012-12-21 9:45 ` Haojian Zhuang [this message]
2013-01-06 23:51 ` [PATCH v6 6/8] tty: pxa: configure pin Linus Walleij
2012-12-21 9:45 ` [PATCH v6 7/8] i2c: pxa: use devm_kzalloc Haojian Zhuang
2012-12-21 9:45 ` [PATCH v6 8/8] i2c: pxa: configure pinmux Haojian Zhuang
2013-01-06 23:52 ` Linus Walleij
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=1356083118-18857-7-git-send-email-haojian.zhuang@linaro.org \
--to=haojian.zhuang@linaro.org \
--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;
as well as URLs for NNTP newsgroup(s).