aboutsummaryrefslogtreecommitdiffstats
path: root/patches.at91/0215-tty-atmel_serial-add-pinctrl-support.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches.at91/0215-tty-atmel_serial-add-pinctrl-support.patch')
-rw-r--r--patches.at91/0215-tty-atmel_serial-add-pinctrl-support.patch49
1 files changed, 49 insertions, 0 deletions
diff --git a/patches.at91/0215-tty-atmel_serial-add-pinctrl-support.patch b/patches.at91/0215-tty-atmel_serial-add-pinctrl-support.patch
new file mode 100644
index 00000000000000..dc8c7ad5589a1e
--- /dev/null
+++ b/patches.at91/0215-tty-atmel_serial-add-pinctrl-support.patch
@@ -0,0 +1,49 @@
+From afea54d51f37890af0531b619ba64331141dc5aa Mon Sep 17 00:00:00 2001
+From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+Date: Fri, 6 Jul 2012 00:41:57 +0800
+Subject: tty: atmel_serial: add pinctrl support
+
+Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
+Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Acked-by: Linus Walleij <linus.walleij@linaro.org>
+Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
+---
+ drivers/tty/serial/atmel_serial.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
+index 3d7e1ee..65f891b 100644
+--- a/drivers/tty/serial/atmel_serial.c
++++ b/drivers/tty/serial/atmel_serial.c
+@@ -39,6 +39,7 @@
+ #include <linux/atmel_pdc.h>
+ #include <linux/atmel_serial.h>
+ #include <linux/uaccess.h>
++#include <linux/pinctrl/consumer.h>
+
+ #include <asm/io.h>
+ #include <asm/ioctls.h>
+@@ -1773,6 +1774,7 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)
+ struct atmel_uart_data *pdata = pdev->dev.platform_data;
+ void *data;
+ int ret = -ENODEV;
++ struct pinctrl *pinctrl;
+
+ BUILD_BUG_ON(ATMEL_SERIAL_RINGSIZE & (ATMEL_SERIAL_RINGSIZE - 1));
+
+@@ -1805,6 +1807,12 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)
+
+ atmel_init_port(port, pdev);
+
++ pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
++ if (IS_ERR(pinctrl)) {
++ ret = PTR_ERR(pinctrl);
++ goto err;
++ }
++
+ if (!atmel_use_dma_rx(&port->uart)) {
+ ret = -ENOMEM;
+ data = kmalloc(sizeof(struct atmel_uart_char)
+--
+1.8.0.197.g5a90748
+