Commit 3dbc5ce2 authored by Tony Lindgren's avatar Tony Lindgren Committed by Greg Kroah-Hartman

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: default avatarTony Lindgren <tony@atomide.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ce2f08de
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/of.h> #include <linux/of.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/pinctrl/consumer.h>
#include <plat/omap-serial.h> #include <plat/omap-serial.h>
...@@ -108,6 +109,7 @@ struct uart_omap_port { ...@@ -108,6 +109,7 @@ struct uart_omap_port {
u32 latency; u32 latency;
u32 calc_latency; u32 calc_latency;
struct work_struct qos_work; struct work_struct qos_work;
struct pinctrl *pins;
}; };
#define to_uart_omap_port(p) ((container_of((p), struct uart_omap_port, port))) #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,6 +1379,13 @@ static int __devinit serial_omap_probe(struct platform_device *pdev)
goto err_port_line; goto err_port_line;
} }
up->pins = devm_pinctrl_get_select_default(&pdev->dev);
if (IS_ERR(up->pins)) {
dev_warn(&pdev->dev, "did not get pins for uart%i error: %li\n",
up->port.line, PTR_ERR(up->pins));
up->pins = NULL;
}
sprintf(up->name, "OMAP UART%d", up->port.line); sprintf(up->name, "OMAP UART%d", up->port.line);
up->port.mapbase = mem->start; up->port.mapbase = mem->start;
up->port.membase = devm_ioremap(&pdev->dev, mem->start, up->port.membase = devm_ioremap(&pdev->dev, mem->start,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment