diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2012-07-05 12:41:57 -0400 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2012-10-12 21:21:44 -0400 |
commit | 784557decc48432c389b3d2ec1cbde515a4b2d9f (patch) | |
tree | 18d83b662db4e47feb7c478a80d1d5618c4eb105 | |
parent | ec6754a7b9e90a1eba7f3b2812003bb51d3dcf30 (diff) |
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>
-rw-r--r-- | drivers/tty/serial/atmel_serial.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c index 3d7e1ee2fa5..65f891be12d 100644 --- a/drivers/tty/serial/atmel_serial.c +++ b/drivers/tty/serial/atmel_serial.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/atmel_pdc.h> | 39 | #include <linux/atmel_pdc.h> |
40 | #include <linux/atmel_serial.h> | 40 | #include <linux/atmel_serial.h> |
41 | #include <linux/uaccess.h> | 41 | #include <linux/uaccess.h> |
42 | #include <linux/pinctrl/consumer.h> | ||
42 | 43 | ||
43 | #include <asm/io.h> | 44 | #include <asm/io.h> |
44 | #include <asm/ioctls.h> | 45 | #include <asm/ioctls.h> |
@@ -1773,6 +1774,7 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev) | |||
1773 | struct atmel_uart_data *pdata = pdev->dev.platform_data; | 1774 | struct atmel_uart_data *pdata = pdev->dev.platform_data; |
1774 | void *data; | 1775 | void *data; |
1775 | int ret = -ENODEV; | 1776 | int ret = -ENODEV; |
1777 | struct pinctrl *pinctrl; | ||
1776 | 1778 | ||
1777 | BUILD_BUG_ON(ATMEL_SERIAL_RINGSIZE & (ATMEL_SERIAL_RINGSIZE - 1)); | 1779 | BUILD_BUG_ON(ATMEL_SERIAL_RINGSIZE & (ATMEL_SERIAL_RINGSIZE - 1)); |
1778 | 1780 | ||
@@ -1805,6 +1807,12 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev) | |||
1805 | 1807 | ||
1806 | atmel_init_port(port, pdev); | 1808 | atmel_init_port(port, pdev); |
1807 | 1809 | ||
1810 | pinctrl = devm_pinctrl_get_select_default(&pdev->dev); | ||
1811 | if (IS_ERR(pinctrl)) { | ||
1812 | ret = PTR_ERR(pinctrl); | ||
1813 | goto err; | ||
1814 | } | ||
1815 | |||
1808 | if (!atmel_use_dma_rx(&port->uart)) { | 1816 | if (!atmel_use_dma_rx(&port->uart)) { |
1809 | ret = -ENOMEM; | 1817 | ret = -ENOMEM; |
1810 | data = kmalloc(sizeof(struct atmel_uart_char) | 1818 | data = kmalloc(sizeof(struct atmel_uart_char) |