* looking for lethal@linux-sh.org--linux/sh--stable--2.6--patch-617 to compare with * comparing to lethal@linux-sh.org--linux/sh--stable--2.6--patch-617 M drivers/serial/sh-sci.c M drivers/serial/sh-sci.h * modified files --- orig/drivers/serial/sh-sci.c +++ mod/drivers/serial/sh-sci.c @@ -62,10 +62,6 @@ #include #endif -#if defined(CONFIG_SERIAL_SH_SCI_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) -#define SUPPORT_SYSRQ -#endif - #ifdef CONFIG_SH_KGDB #include @@ -210,7 +206,7 @@ #if defined(__H8300S__) enum { sci_disable, sci_enable }; -static void h8300_sci_enable(struct uart_port* port, unsigned int ctrl) +static void h8300_sci_config(struct uart_port* port, unsigned int ctrl) { volatile unsigned char *mstpcrl=(volatile unsigned char *)MSTPCRL; int ch = (port->mapbase - SMR0) >> 3; @@ -222,6 +218,16 @@ *mstpcrl &= ~mask; } } + +static inline void h8300_sci_enable(struct uart_port *port) +{ + h8300_sci_config(port, sci_enable); +} + +static inline void h8300_sci_disable(struct uart_port *port) +{ + h8300_sci_config(port, sci_disable); +} #endif #if defined(SCI_ONLY) || defined(SCI_AND_SCIF) @@ -917,9 +923,8 @@ { struct sci_port *s = &sci_ports[port->line]; -#if defined(__H8300S__) - h8300_sci_enable(port, sci_enable); -#endif + if (s->enable) + s->enable(port); sci_request_irq(s); sci_start_tx(port); @@ -936,9 +941,8 @@ sci_stop_tx(port); sci_free_irq(s); -#if defined(__H8300S__) - h8300_sci_enable(port, sci_disable); -#endif + if (s->disable) + s->disable(port); } static void sci_set_termios(struct uart_port *port, struct termios *termios, @@ -1387,6 +1391,8 @@ .type = PORT_SCI, .irqs = H8S_SCI_IRQS0, .init_pins = sci_init_pins_sci, + .enable = h8300_sci_enable, + .disable = h8300_sci_disable, }, { .port = { @@ -1401,6 +1407,8 @@ .type = PORT_SCI, .irqs = H8S_SCI_IRQS1, .init_pins = sci_init_pins_sci, + .enable = h8300_sci_enable, + .disable = h8300_sci_disable, }, { .port = { @@ -1415,6 +1423,8 @@ .type = PORT_SCI, .irqs = H8S_SCI_IRQS2, .init_pins = sci_init_pins_sci, + .enable = h8300_sci_enable, + .disable = h8300_sci_disable, }, #elif defined(CONFIG_CPU_SUBTYPE_SH7770) { @@ -1522,16 +1532,15 @@ sci_config_port(port, 0); #endif + if (serial_console_port->enable) + serial_console_port->enable(port); + /* * We need to set the initial uartclk here, since otherwise it will * only ever be setup at sci_init() time. */ #if defined(__H8300H__) || defined(__H8300S__) port->uartclk = CONFIG_CPU_CLOCK; - -#if defined(__H8300S__) - h8300_sci_enable(port, sci_enable); -#endif #elif defined(CONFIG_SUPERH64) port->uartclk = current_cpu_info.module_clock * 16; #else --- orig/drivers/serial/sh-sci.h +++ mod/drivers/serial/sh-sci.h @@ -279,6 +279,8 @@ int type; unsigned char irqs[4]; /* ERI, RXI, TXI, BRI */ void (*init_pins)(struct uart_port *port, unsigned int cflag); + void (*enable)(struct uart_port *port); + void (*disable)(struct uart_port *port); int break_flag; struct timer_list break_timer; };