linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tty/serial/8250: Make omap hardware workarounds local to 8250.h
@ 2012-10-03 22:31 Tony Lindgren
  2012-10-03 23:25 ` Greg Kroah-Hartman
  2012-10-24 18:31 ` Greg Kroah-Hartman
  0 siblings, 2 replies; 4+ messages in thread
From: Tony Lindgren @ 2012-10-03 22:31 UTC (permalink / raw)
  Cc: Alan Cox, Greg Kroah-Hartman, linux-serial

This allows us to get rid of the ifdefs in 8250.c.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Alan Cox <alan@linux.intel.com>
Cc: linux-serial@vger.kernel.org
Cc: linux-omap@vger.kernel.org
Signed-off-by: Tony Lindgren <tony@atomide.com>

---

Would appreciate some minimal immutable branch
with this commit that I can also pull in to my
upcoming omap cleanup branch for v3.8 merge window
as I'll be moving plat/serial.h for the ARM common
zImage changes.

--- a/arch/arm/plat-omap/include/plat/serial.h
+++ b/arch/arm/plat-omap/include/plat/serial.h
@@ -109,15 +109,6 @@
 #define OMAP5UART4		OMAP4UART4
 #define ZOOM_UART		95		/* Only on zoom2/3 */
 
-/* This is only used by 8250.c for omap1510 */
-#define is_omap_port(pt)	({int __ret = 0;			\
-			if ((pt)->port.mapbase == OMAP1_UART1_BASE ||	\
-			    (pt)->port.mapbase == OMAP1_UART2_BASE ||	\
-			    (pt)->port.mapbase == OMAP1_UART3_BASE)	\
-				__ret = 1;				\
-			__ret;						\
-			})
-
 #ifndef __ASSEMBLER__
 
 struct omap_board_data;
--- a/drivers/tty/serial/8250/8250.c
+++ b/drivers/tty/serial/8250/8250.c
@@ -2349,16 +2349,14 @@ serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
 			serial_port_out(port, UART_EFR, efr);
 	}
 
-#ifdef CONFIG_ARCH_OMAP1
 	/* Workaround to enable 115200 baud on OMAP1510 internal ports */
-	if (cpu_is_omap1510() && is_omap_port(up)) {
+	if (is_omap1510_8250(up)) {
 		if (baud == 115200) {
 			quot = 1;
 			serial_port_out(port, UART_OMAP_OSC_12M_SEL, 1);
 		} else
 			serial_port_out(port, UART_OMAP_OSC_12M_SEL, 0);
 	}
-#endif
 
 	/*
 	 * For NatSemi, switch to bank 2 not bank 1, to avoid resetting EXCR2,
@@ -2439,10 +2437,9 @@ static unsigned int serial8250_port_size(struct uart_8250_port *pt)
 {
 	if (pt->port.iotype == UPIO_AU)
 		return 0x1000;
-#ifdef CONFIG_ARCH_OMAP1
-	if (is_omap_port(pt))
+	if (is_omap1_8250(pt))
 		return 0x16 << pt->port.regshift;
-#endif
+
 	return 8 << pt->port.regshift;
 }
 
--- a/drivers/tty/serial/8250/8250.h
+++ b/drivers/tty/serial/8250/8250.h
@@ -106,3 +106,39 @@ static inline int serial8250_pnp_init(void) { return 0; }
 static inline void serial8250_pnp_exit(void) { }
 #endif
 
+#ifdef CONFIG_ARCH_OMAP1
+static inline int is_omap1_8250(struct uart_8250_port *pt)
+{
+	int res;
+
+	switch (pt->port.mapbase) {
+	case OMAP1_UART1_BASE:
+	case OMAP1_UART2_BASE:
+	case OMAP1_UART3_BASE:
+		res = 1;
+		break;
+	default:
+		res = 0;
+		break;
+	}
+
+	return res;
+}
+
+static inline int is_omap1510_8250(struct uart_8250_port *pt)
+{
+	if (!cpu_is_omap1510())
+		return 0;
+
+	return is_omap1_8250(pt);
+}
+#else
+static inline int is_omap1_8250(struct uart_8250_port *pt)
+{
+	return 0;
+}
+static inline int is_omap1510_8250(struct uart_8250_port *pt)
+{
+	return 0;
+}
+#endif

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tty/serial/8250: Make omap hardware workarounds local to 8250.h
  2012-10-03 22:31 [PATCH] tty/serial/8250: Make omap hardware workarounds local to 8250.h Tony Lindgren
@ 2012-10-03 23:25 ` Greg Kroah-Hartman
  2012-10-03 23:51   ` Tony Lindgren
  2012-10-24 18:31 ` Greg Kroah-Hartman
  1 sibling, 1 reply; 4+ messages in thread
From: Greg Kroah-Hartman @ 2012-10-03 23:25 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-serial, Alan Cox

On Wed, Oct 03, 2012 at 03:31:58PM -0700, Tony Lindgren wrote:
> This allows us to get rid of the ifdefs in 8250.c.
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Alan Cox <alan@linux.intel.com>
> Cc: linux-serial@vger.kernel.org
> Cc: linux-omap@vger.kernel.org
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> 
> ---
> 
> Would appreciate some minimal immutable branch
> with this commit that I can also pull in to my
> upcoming omap cleanup branch for v3.8 merge window
> as I'll be moving plat/serial.h for the ARM common
> zImage changes.

Please wait for 3.7-rc1 to come out before I can do that.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tty/serial/8250: Make omap hardware workarounds local to 8250.h
  2012-10-03 23:25 ` Greg Kroah-Hartman
@ 2012-10-03 23:51   ` Tony Lindgren
  0 siblings, 0 replies; 4+ messages in thread
From: Tony Lindgren @ 2012-10-03 23:51 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-serial, Alan Cox

* Greg Kroah-Hartman <gregkh@linuxfoundation.org> [121003 16:27]:
> On Wed, Oct 03, 2012 at 03:31:58PM -0700, Tony Lindgren wrote:
> > This allows us to get rid of the ifdefs in 8250.c.
> > 
> > Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > Cc: Alan Cox <alan@linux.intel.com>
> > Cc: linux-serial@vger.kernel.org
> > Cc: linux-omap@vger.kernel.org
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > 
> > ---
> > 
> > Would appreciate some minimal immutable branch
> > with this commit that I can also pull in to my
> > upcoming omap cleanup branch for v3.8 merge window
> > as I'll be moving plat/serial.h for the ARM common
> > zImage changes.
> 
> Please wait for 3.7-rc1 to come out before I can do that.

OK thanks, rc1 is what I'm waiting for as well before
I apply my series.

Regards,

Tony

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] tty/serial/8250: Make omap hardware workarounds local to 8250.h
  2012-10-03 22:31 [PATCH] tty/serial/8250: Make omap hardware workarounds local to 8250.h Tony Lindgren
  2012-10-03 23:25 ` Greg Kroah-Hartman
@ 2012-10-24 18:31 ` Greg Kroah-Hartman
  1 sibling, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2012-10-24 18:31 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-serial, Alan Cox

On Wed, Oct 03, 2012 at 03:31:58PM -0700, Tony Lindgren wrote:
> This allows us to get rid of the ifdefs in 8250.c.
> 
> Cc: Alan Cox <alan@linux.intel.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> 
> ---
> 
> Would appreciate some minimal immutable branch
> with this commit that I can also pull in to my
> upcoming omap cleanup branch for v3.8 merge window
> as I'll be moving plat/serial.h for the ARM common
> zImage changes.

This is now in my tty-next branch of the tty.git tree, if you want to
pull from that.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-10-24 18:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-03 22:31 [PATCH] tty/serial/8250: Make omap hardware workarounds local to 8250.h Tony Lindgren
2012-10-03 23:25 ` Greg Kroah-Hartman
2012-10-03 23:51   ` Tony Lindgren
2012-10-24 18:31 ` Greg Kroah-Hartman

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).