* [PATCH] serial: omap: Request pins using pinctrl framework
@ 2012-09-07 17:59 Tony Lindgren
2012-09-07 18:27 ` Tony Lindgren
0 siblings, 1 reply; 2+ messages in thread
From: Tony Lindgren @ 2012-09-07 17:59 UTC (permalink / raw)
To: linux-arm-kernel
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>
---
Note that this has only so far been tested with the legacy
non-devicetree boot as devicetree boot now has a regression
issue with omap-serial.
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -40,6 +40,7 @@
#include <linux/pm_runtime.h>
#include <linux/of.h>
#include <linux/gpio.h>
+#include <linux/pinctrl/consumer.h>
#include <plat/omap-serial.h>
@@ -108,6 +109,7 @@ struct uart_omap_port {
u32 latency;
u32 calc_latency;
struct work_struct qos_work;
+ struct pinctrl *pins;
};
#define to_uart_omap_port(p) ((container_of((p), struct uart_omap_port, port)))
@@ -1371,6 +1373,13 @@ static int __devinit serial_omap_probe(struct platform_device *pdev)
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);
up->port.mapbase = mem->start;
up->port.membase = devm_ioremap(&pdev->dev, mem->start,
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH] serial: omap: Request pins using pinctrl framework
2012-09-07 17:59 [PATCH] serial: omap: Request pins using pinctrl framework Tony Lindgren
@ 2012-09-07 18:27 ` Tony Lindgren
0 siblings, 0 replies; 2+ messages in thread
From: Tony Lindgren @ 2012-09-07 18:27 UTC (permalink / raw)
To: linux-arm-kernel
* Tony Lindgren <tony@atomide.com> [120907 11:00]:
> 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>
>
> ---
>
> Note that this has only so far been tested with the legacy
> non-devicetree boot as devicetree boot now has a regression
> issue with omap-serial.
Now also tested with devicetree case on top tty-next +
Felipe's "[PATCH] serial: omap: fix DeviceTree boot.
Tony
> --- a/drivers/tty/serial/omap-serial.c
> +++ b/drivers/tty/serial/omap-serial.c
> @@ -40,6 +40,7 @@
> #include <linux/pm_runtime.h>
> #include <linux/of.h>
> #include <linux/gpio.h>
> +#include <linux/pinctrl/consumer.h>
>
> #include <plat/omap-serial.h>
>
> @@ -108,6 +109,7 @@ struct uart_omap_port {
> u32 latency;
> u32 calc_latency;
> struct work_struct qos_work;
> + struct pinctrl *pins;
> };
>
> #define to_uart_omap_port(p) ((container_of((p), struct uart_omap_port, port)))
> @@ -1371,6 +1373,13 @@ static int __devinit serial_omap_probe(struct platform_device *pdev)
> 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);
> up->port.mapbase = mem->start;
> up->port.membase = devm_ioremap(&pdev->dev, mem->start,
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-09-07 18:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-07 17:59 [PATCH] serial: omap: Request pins using pinctrl framework Tony Lindgren
2012-09-07 18:27 ` Tony Lindgren
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).