* [PATCH 5/5] omap-serial: Request pins using pinctrl framework
[not found] <20120906185615.1172.23588.stgit@muffinssi.local>
@ 2012-09-06 18:58 ` Tony Lindgren
2012-09-06 19:12 ` Tony Lindgren
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Tony Lindgren @ 2012-09-06 18:58 UTC (permalink / raw)
To: linux-arm-kernel; +Cc: Greg Kroah-Hartman, linux-omap, linux-serial
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.
Cc: linux-serial@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
arch/arm/plat-omap/include/plat/omap-serial.h | 1 +
drivers/tty/serial/omap-serial.c | 10 ++++++++++
2 files changed, 11 insertions(+)
diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
index 1a52725..0f4de14 100644
--- a/arch/arm/plat-omap/include/plat/omap-serial.h
+++ b/arch/arm/plat-omap/include/plat/omap-serial.h
@@ -106,6 +106,7 @@ struct uart_omap_port {
struct uart_port port;
struct uart_omap_dma uart_dma;
struct platform_device *pdev;
+ struct pinctrl *pins;
unsigned char ier;
unsigned char lcr;
diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
index d3cda0c..068e88c 100644
--- a/drivers/tty/serial/omap-serial.c
+++ b/drivers/tty/serial/omap-serial.c
@@ -39,6 +39,7 @@
#include <linux/irq.h>
#include <linux/pm_runtime.h>
#include <linux/of.h>
+#include <linux/pinctrl/consumer.h>
#include <plat/dma.h>
#include <plat/dmtimer.h>
@@ -1492,6 +1493,13 @@ static int serial_omap_probe(struct platform_device *pdev)
goto err_port_line;
}
+ up->pins = 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,
@@ -1570,6 +1578,8 @@ static int serial_omap_remove(struct platform_device *dev)
pm_runtime_disable(&up->pdev->dev);
uart_remove_one_port(&serial_omap_reg, &up->port);
pm_qos_remove_request(&up->pm_qos_request);
+ if (up->pins)
+ pinctrl_put(up->pins);
}
platform_set_drvdata(dev, NULL);
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 5/5] omap-serial: Request pins using pinctrl framework
2012-09-06 18:58 ` [PATCH 5/5] omap-serial: Request pins using pinctrl framework Tony Lindgren
@ 2012-09-06 19:12 ` Tony Lindgren
2012-09-06 19:56 ` Felipe Balbi
2012-09-07 3:27 ` AnilKumar, Chimata
2 siblings, 0 replies; 8+ messages in thread
From: Tony Lindgren @ 2012-09-06 19:12 UTC (permalink / raw)
To: linux-arm-kernel; +Cc: Greg Kroah-Hartman, linux-omap, linux-serial
* Tony Lindgren <tony@atomide.com> [120906 11:59]:
> 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.
>
> Cc: linux-serial@vger.kernel.org
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
Greg, this patch should be OK for you to pick, it should not break
anything even if pinctrl is not available yet. Let me know if it
needs rebasing on top of other things you've queued for omap-serial.
Regards,
Tony
> arch/arm/plat-omap/include/plat/omap-serial.h | 1 +
> drivers/tty/serial/omap-serial.c | 10 ++++++++++
> 2 files changed, 11 insertions(+)
>
> diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
> index 1a52725..0f4de14 100644
> --- a/arch/arm/plat-omap/include/plat/omap-serial.h
> +++ b/arch/arm/plat-omap/include/plat/omap-serial.h
> @@ -106,6 +106,7 @@ struct uart_omap_port {
> struct uart_port port;
> struct uart_omap_dma uart_dma;
> struct platform_device *pdev;
> + struct pinctrl *pins;
>
> unsigned char ier;
> unsigned char lcr;
> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
> index d3cda0c..068e88c 100644
> --- a/drivers/tty/serial/omap-serial.c
> +++ b/drivers/tty/serial/omap-serial.c
> @@ -39,6 +39,7 @@
> #include <linux/irq.h>
> #include <linux/pm_runtime.h>
> #include <linux/of.h>
> +#include <linux/pinctrl/consumer.h>
>
> #include <plat/dma.h>
> #include <plat/dmtimer.h>
> @@ -1492,6 +1493,13 @@ static int serial_omap_probe(struct platform_device *pdev)
> goto err_port_line;
> }
>
> + up->pins = 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,
> @@ -1570,6 +1578,8 @@ static int serial_omap_remove(struct platform_device *dev)
> pm_runtime_disable(&up->pdev->dev);
> uart_remove_one_port(&serial_omap_reg, &up->port);
> pm_qos_remove_request(&up->pm_qos_request);
> + if (up->pins)
> + pinctrl_put(up->pins);
> }
>
> platform_set_drvdata(dev, NULL);
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 5/5] omap-serial: Request pins using pinctrl framework
2012-09-06 18:58 ` [PATCH 5/5] omap-serial: Request pins using pinctrl framework Tony Lindgren
2012-09-06 19:12 ` Tony Lindgren
@ 2012-09-06 19:56 ` Felipe Balbi
2012-09-06 21:17 ` Tony Lindgren
2012-09-07 3:27 ` AnilKumar, Chimata
2 siblings, 1 reply; 8+ messages in thread
From: Felipe Balbi @ 2012-09-06 19:56 UTC (permalink / raw)
To: Tony Lindgren
Cc: linux-arm-kernel, Greg Kroah-Hartman, linux-omap, linux-serial
[-- Attachment #1: Type: text/plain, Size: 1075 bytes --]
Hi,
On Thu, Sep 06, 2012 at 11:58:32AM -0700, Tony Lindgren wrote:
> 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.
>
> Cc: linux-serial@vger.kernel.org
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> arch/arm/plat-omap/include/plat/omap-serial.h | 1 +
> drivers/tty/serial/omap-serial.c | 10 ++++++++++
> 2 files changed, 11 insertions(+)
>
> diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
> index 1a52725..0f4de14 100644
> --- a/arch/arm/plat-omap/include/plat/omap-serial.h
> +++ b/arch/arm/plat-omap/include/plat/omap-serial.h
> @@ -106,6 +106,7 @@ struct uart_omap_port {
> struct uart_port port;
> struct uart_omap_dma uart_dma;
> struct platform_device *pdev;
> + struct pinctrl *pins;
this won't apply to Greg's tty-next as I moved this structure to the C
file :-s
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 5/5] omap-serial: Request pins using pinctrl framework
2012-09-06 19:56 ` Felipe Balbi
@ 2012-09-06 21:17 ` Tony Lindgren
2012-09-07 5:26 ` Felipe Balbi
0 siblings, 1 reply; 8+ messages in thread
From: Tony Lindgren @ 2012-09-06 21:17 UTC (permalink / raw)
To: Felipe Balbi
Cc: linux-arm-kernel, Greg Kroah-Hartman, linux-omap, linux-serial
* Felipe Balbi <balbi@ti.com> [120906 13:01]:
> Hi,
>
> On Thu, Sep 06, 2012 at 11:58:32AM -0700, Tony Lindgren wrote:
> > 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.
> >
> > Cc: linux-serial@vger.kernel.org
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > ---
> > arch/arm/plat-omap/include/plat/omap-serial.h | 1 +
> > drivers/tty/serial/omap-serial.c | 10 ++++++++++
> > 2 files changed, 11 insertions(+)
> >
> > diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
> > index 1a52725..0f4de14 100644
> > --- a/arch/arm/plat-omap/include/plat/omap-serial.h
> > +++ b/arch/arm/plat-omap/include/plat/omap-serial.h
> > @@ -106,6 +106,7 @@ struct uart_omap_port {
> > struct uart_port port;
> > struct uart_omap_dma uart_dma;
> > struct platform_device *pdev;
> > + struct pinctrl *pins;
>
> this won't apply to Greg's tty-next as I moved this structure to the C
> file :-s
Hmm the tty-next fails to build right now for omaps:
drivers/tty/serial/omap-serial.c: In function ‘serial_omap_set_mctrl’:
drivers/tty/serial/omap-serial.c:514: error: ‘struct uart_omap_port’ has no member named ‘DTR_gpio’
Maybe check how you want to fix that first? I can then update
my patch for tty-next.
Regards,
Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH 5/5] omap-serial: Request pins using pinctrl framework
2012-09-06 18:58 ` [PATCH 5/5] omap-serial: Request pins using pinctrl framework Tony Lindgren
2012-09-06 19:12 ` Tony Lindgren
2012-09-06 19:56 ` Felipe Balbi
@ 2012-09-07 3:27 ` AnilKumar, Chimata
2012-09-07 17:28 ` Tony Lindgren
2 siblings, 1 reply; 8+ messages in thread
From: AnilKumar, Chimata @ 2012-09-07 3:27 UTC (permalink / raw)
To: Tony Lindgren, linux-arm-kernel@lists.infradead.org
Cc: Greg Kroah-Hartman, linux-omap@vger.kernel.org,
linux-serial@vger.kernel.org
Hi Tony,
On Fri, Sep 07, 2012 at 00:28:32, Tony Lindgren wrote:
> 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.
>
> Cc: linux-serial@vger.kernel.org
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> arch/arm/plat-omap/include/plat/omap-serial.h | 1 +
> drivers/tty/serial/omap-serial.c | 10 ++++++++++
> 2 files changed, 11 insertions(+)
>
> diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
> index 1a52725..0f4de14 100644
> --- a/arch/arm/plat-omap/include/plat/omap-serial.h
> +++ b/arch/arm/plat-omap/include/plat/omap-serial.h
> @@ -106,6 +106,7 @@ struct uart_omap_port {
> struct uart_port port;
> struct uart_omap_dma uart_dma;
> struct platform_device *pdev;
> + struct pinctrl *pins;
>
> unsigned char ier;
> unsigned char lcr;
> diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
> index d3cda0c..068e88c 100644
> --- a/drivers/tty/serial/omap-serial.c
> +++ b/drivers/tty/serial/omap-serial.c
> @@ -39,6 +39,7 @@
> #include <linux/irq.h>
> #include <linux/pm_runtime.h>
> #include <linux/of.h>
> +#include <linux/pinctrl/consumer.h>
>
> #include <plat/dma.h>
> #include <plat/dmtimer.h>
> @@ -1492,6 +1493,13 @@ static int serial_omap_probe(struct platform_device *pdev)
> goto err_port_line;
> }
>
> + up->pins = 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,
> @@ -1570,6 +1578,8 @@ static int serial_omap_remove(struct platform_device *dev)
> pm_runtime_disable(&up->pdev->dev);
> uart_remove_one_port(&serial_omap_reg, &up->port);
> pm_qos_remove_request(&up->pm_qos_request);
> + if (up->pins)
> + pinctrl_put(up->pins);
I think this can be removed if we use devm_pinctrl_get_select_default()
above.
Thanks
AnilKumar
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 5/5] omap-serial: Request pins using pinctrl framework
2012-09-06 21:17 ` Tony Lindgren
@ 2012-09-07 5:26 ` Felipe Balbi
0 siblings, 0 replies; 8+ messages in thread
From: Felipe Balbi @ 2012-09-07 5:26 UTC (permalink / raw)
To: Tony Lindgren
Cc: Felipe Balbi, linux-arm-kernel, Greg Kroah-Hartman, linux-omap,
linux-serial
[-- Attachment #1: Type: text/plain, Size: 1680 bytes --]
Hi,
On Thu, Sep 06, 2012 at 02:17:26PM -0700, Tony Lindgren wrote:
> * Felipe Balbi <balbi@ti.com> [120906 13:01]:
> > Hi,
> >
> > On Thu, Sep 06, 2012 at 11:58:32AM -0700, Tony Lindgren wrote:
> > > 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.
> > >
> > > Cc: linux-serial@vger.kernel.org
> > > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > > ---
> > > arch/arm/plat-omap/include/plat/omap-serial.h | 1 +
> > > drivers/tty/serial/omap-serial.c | 10 ++++++++++
> > > 2 files changed, 11 insertions(+)
> > >
> > > diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
> > > index 1a52725..0f4de14 100644
> > > --- a/arch/arm/plat-omap/include/plat/omap-serial.h
> > > +++ b/arch/arm/plat-omap/include/plat/omap-serial.h
> > > @@ -106,6 +106,7 @@ struct uart_omap_port {
> > > struct uart_port port;
> > > struct uart_omap_dma uart_dma;
> > > struct platform_device *pdev;
> > > + struct pinctrl *pins;
> >
> > this won't apply to Greg's tty-next as I moved this structure to the C
> > file :-s
>
> Hmm the tty-next fails to build right now for omaps:
>
> drivers/tty/serial/omap-serial.c: In function ‘serial_omap_set_mctrl’:
> drivers/tty/serial/omap-serial.c:514: error: ‘struct uart_omap_port’ has no member named ‘DTR_gpio’
>
> Maybe check how you want to fix that first? I can then update
> my patch for tty-next.
oops, my bad. Patch sent.
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 5/5] omap-serial: Request pins using pinctrl framework
2012-09-07 3:27 ` AnilKumar, Chimata
@ 2012-09-07 17:28 ` Tony Lindgren
2012-09-07 18:03 ` Tony Lindgren
0 siblings, 1 reply; 8+ messages in thread
From: Tony Lindgren @ 2012-09-07 17:28 UTC (permalink / raw)
To: AnilKumar, Chimata
Cc: linux-arm-kernel@lists.infradead.org, Greg Kroah-Hartman,
linux-omap@vger.kernel.org, linux-serial@vger.kernel.org
* AnilKumar, Chimata <anilkumar@ti.com> [120906 20:27]:
> Hi Tony,
>
> On Fri, Sep 07, 2012 at 00:28:32, Tony Lindgren wrote:
> > 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.
> >
> > Cc: linux-serial@vger.kernel.org
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > ---
> > arch/arm/plat-omap/include/plat/omap-serial.h | 1 +
> > drivers/tty/serial/omap-serial.c | 10 ++++++++++
> > 2 files changed, 11 insertions(+)
> >
> > diff --git a/arch/arm/plat-omap/include/plat/omap-serial.h b/arch/arm/plat-omap/include/plat/omap-serial.h
> > index 1a52725..0f4de14 100644
> > --- a/arch/arm/plat-omap/include/plat/omap-serial.h
> > +++ b/arch/arm/plat-omap/include/plat/omap-serial.h
> > @@ -106,6 +106,7 @@ struct uart_omap_port {
> > struct uart_port port;
> > struct uart_omap_dma uart_dma;
> > struct platform_device *pdev;
> > + struct pinctrl *pins;
> >
> > unsigned char ier;
> > unsigned char lcr;
> > diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c
> > index d3cda0c..068e88c 100644
> > --- a/drivers/tty/serial/omap-serial.c
> > +++ b/drivers/tty/serial/omap-serial.c
> > @@ -39,6 +39,7 @@
> > #include <linux/irq.h>
> > #include <linux/pm_runtime.h>
> > #include <linux/of.h>
> > +#include <linux/pinctrl/consumer.h>
> >
> > #include <plat/dma.h>
> > #include <plat/dmtimer.h>
> > @@ -1492,6 +1493,13 @@ static int serial_omap_probe(struct platform_device *pdev)
> > goto err_port_line;
> > }
> >
> > + up->pins = 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,
> > @@ -1570,6 +1578,8 @@ static int serial_omap_remove(struct platform_device *dev)
> > pm_runtime_disable(&up->pdev->dev);
> > uart_remove_one_port(&serial_omap_reg, &up->port);
> > pm_qos_remove_request(&up->pm_qos_request);
> > + if (up->pins)
> > + pinctrl_put(up->pins);
>
> I think this can be removed if we use devm_pinctrl_get_select_default()
> above.
Yeah will do, I was initially thinking that would cause issues remuxing
pins back to safe mode on unload, but we can still do that in
serial_omap_remove().
Regards,
Tony
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 5/5] omap-serial: Request pins using pinctrl framework
2012-09-07 17:28 ` Tony Lindgren
@ 2012-09-07 18:03 ` Tony Lindgren
0 siblings, 0 replies; 8+ messages in thread
From: Tony Lindgren @ 2012-09-07 18:03 UTC (permalink / raw)
To: AnilKumar, Chimata
Cc: linux-arm-kernel@lists.infradead.org, Greg Kroah-Hartman,
linux-omap@vger.kernel.org, linux-serial@vger.kernel.org
* Tony Lindgren <tony@atomide.com> [120907 10:29]:
> * AnilKumar, Chimata <anilkumar@ti.com> [120906 20:27]:
> > > @@ -1570,6 +1578,8 @@ static int serial_omap_remove(struct platform_device *dev)
> > > pm_runtime_disable(&up->pdev->dev);
> > > uart_remove_one_port(&serial_omap_reg, &up->port);
> > > pm_qos_remove_request(&up->pm_qos_request);
> > > + if (up->pins)
> > > + pinctrl_put(up->pins);
> >
> > I think this can be removed if we use devm_pinctrl_get_select_default()
> > above.
>
> Yeah will do, I was initially thinking that would cause issues remuxing
> pins back to safe mode on unload, but we can still do that in
> serial_omap_remove().
Sent now as a separate patch with subject "[PATCH] serial: omap: Request
pins using pinctrl framework".
Regards,
Tony
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2012-09-07 18:03 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20120906185615.1172.23588.stgit@muffinssi.local>
2012-09-06 18:58 ` [PATCH 5/5] omap-serial: Request pins using pinctrl framework Tony Lindgren
2012-09-06 19:12 ` Tony Lindgren
2012-09-06 19:56 ` Felipe Balbi
2012-09-06 21:17 ` Tony Lindgren
2012-09-07 5:26 ` Felipe Balbi
2012-09-07 3:27 ` AnilKumar, Chimata
2012-09-07 17:28 ` Tony Lindgren
2012-09-07 18:03 ` 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).