From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] serial: omap: Request pins using pinctrl framework
Date: Fri, 7 Sep 2012 11:27:29 -0700 [thread overview]
Message-ID: <20120907182729.GK1303@atomide.com> (raw)
In-Reply-To: <20120907175939.GE1303@atomide.com>
* 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
prev parent reply other threads:[~2012-09-07 18:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-07 17:59 [PATCH] serial: omap: Request pins using pinctrl framework Tony Lindgren
2012-09-07 18:27 ` Tony Lindgren [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120907182729.GK1303@atomide.com \
--to=tony@atomide.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).