aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/tty/serial/omap-serial.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2012-09-07 13:59:40 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-09-10 19:31:09 -0400
commit3dbc5ce2bffa40ef9a95247f3e9ea0f8874489ac (patch)
tree60abe129a805ce6ecb2107c0de6fd19ab177590f /drivers/tty/serial/omap-serial.c
parentce2f08ded291188b684e3d2e9940132514ada0a9 (diff)
serial: omap: Request pins using pinctrl framework
Request pins using pinctrl framework. Only show a warning on error as some boards set the pins in the bootloader even if CONFIG_PINCTRL is enabled. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/serial/omap-serial.c')
-rw-r--r--drivers/tty/serial/omap-serial.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index 743e8e1249da..f175385bb304 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -40,6 +40,7 @@
40#include <linux/pm_runtime.h> 40#include <linux/pm_runtime.h>
41#include <linux/of.h> 41#include <linux/of.h>
42#include <linux/gpio.h> 42#include <linux/gpio.h>
43#include <linux/pinctrl/consumer.h>
43 44
44#include <plat/omap-serial.h> 45#include <plat/omap-serial.h>
45 46
@@ -108,6 +109,7 @@ struct uart_omap_port {
108 u32 latency; 109 u32 latency;
109 u32 calc_latency; 110 u32 calc_latency;
110 struct work_struct qos_work; 111 struct work_struct qos_work;
112 struct pinctrl *pins;
111}; 113};
112 114
113#define to_uart_omap_port(p) ((container_of((p), struct uart_omap_port, port))) 115#define to_uart_omap_port(p) ((container_of((p), struct uart_omap_port, port)))
@@ -1377,6 +1379,13 @@ static int __devinit serial_omap_probe(struct platform_device *pdev)
1377 goto err_port_line; 1379 goto err_port_line;
1378 } 1380 }
1379 1381
1382 up->pins = devm_pinctrl_get_select_default(&pdev->dev);
1383 if (IS_ERR(up->pins)) {
1384 dev_warn(&pdev->dev, "did not get pins for uart%i error: %li\n",
1385 up->port.line, PTR_ERR(up->pins));
1386 up->pins = NULL;
1387 }
1388
1380 sprintf(up->name, "OMAP UART%d", up->port.line); 1389 sprintf(up->name, "OMAP UART%d", up->port.line);
1381 up->port.mapbase = mem->start; 1390 up->port.mapbase = mem->start;
1382 up->port.membase = devm_ioremap(&pdev->dev, mem->start, 1391 up->port.membase = devm_ioremap(&pdev->dev, mem->start,