diff options
author | Marc Singer <elf@buici.com> | 2006-05-16 06:41:29 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-06-18 11:16:46 -0400 |
commit | fb62c5a7043617dd9d678beafc368b217aa28da4 (patch) | |
tree | 0e97b7e1ae185f0bfaef618c92d59d8b1368954d /drivers/serial/serial_lh7a40x.c | |
parent | 638b266630db8d492255d340e18d46ba6ab1b057 (diff) |
[ARM] 3402/1: lpd7a40x: serial driver bug fix
Patch from Marc Singer
The serial driver now sets up the third UART when it is to be used.
Signed-off-by: Marc Singer <elf@buici.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/serial/serial_lh7a40x.c')
-rw-r--r-- | drivers/serial/serial_lh7a40x.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/serial/serial_lh7a40x.c b/drivers/serial/serial_lh7a40x.c index aa521b8e0d4e..776d4ff06084 100644 --- a/drivers/serial/serial_lh7a40x.c +++ b/drivers/serial/serial_lh7a40x.c | |||
@@ -145,14 +145,15 @@ lh7a40xuart_rx_chars (struct uart_port* port) | |||
145 | { | 145 | { |
146 | struct tty_struct* tty = port->info->tty; | 146 | struct tty_struct* tty = port->info->tty; |
147 | int cbRxMax = 256; /* (Gross) limit on receive */ | 147 | int cbRxMax = 256; /* (Gross) limit on receive */ |
148 | unsigned int data, flag;/* Received data and status */ | 148 | unsigned int data; /* Received data and status */ |
149 | unsigned int flag; | ||
149 | 150 | ||
150 | while (!(UR (port, UART_R_STATUS) & nRxRdy) && --cbRxMax) { | 151 | while (!(UR (port, UART_R_STATUS) & nRxRdy) && --cbRxMax) { |
151 | data = UR (port, UART_R_DATA); | 152 | data = UR (port, UART_R_DATA); |
152 | flag = TTY_NORMAL; | 153 | flag = TTY_NORMAL; |
153 | ++port->icount.rx; | 154 | ++port->icount.rx; |
154 | 155 | ||
155 | if (unlikely(data & RxError)) { /* Quick check, short-circuit */ | 156 | if (unlikely(data & RxError)) { |
156 | if (data & RxBreak) { | 157 | if (data & RxBreak) { |
157 | data &= ~(RxFramingError | RxParityError); | 158 | data &= ~(RxFramingError | RxParityError); |
158 | ++port->icount.brk; | 159 | ++port->icount.brk; |
@@ -303,7 +304,7 @@ static void lh7a40xuart_set_mctrl (struct uart_port* port, unsigned int mctrl) | |||
303 | /* Note, kernel appears to be setting DTR and RTS on console. */ | 304 | /* Note, kernel appears to be setting DTR and RTS on console. */ |
304 | 305 | ||
305 | /* *** FIXME: this deserves more work. There's some work in | 306 | /* *** FIXME: this deserves more work. There's some work in |
306 | tracing all of the IO pins. */ | 307 | tracing all of the IO pins. */ |
307 | #if 0 | 308 | #if 0 |
308 | if( port->mapbase == UART1_PHYS) { | 309 | if( port->mapbase == UART1_PHYS) { |
309 | gpioRegs_t *gpio = (gpioRegs_t *)IO_ADDRESS(GPIO_PHYS); | 310 | gpioRegs_t *gpio = (gpioRegs_t *)IO_ADDRESS(GPIO_PHYS); |
@@ -662,9 +663,13 @@ static int __init lh7a40xuart_init(void) | |||
662 | if (ret == 0) { | 663 | if (ret == 0) { |
663 | int i; | 664 | int i; |
664 | 665 | ||
665 | for (i = 0; i < DEV_NR; i++) | 666 | for (i = 0; i < DEV_NR; i++) { |
667 | /* UART3, when used, requires GPIO pin reallocation */ | ||
668 | if (lh7a40x_ports[i].port.mapbase == UART3_PHYS) | ||
669 | GPIO_PINMUX |= 1<<3; | ||
666 | uart_add_one_port (&lh7a40x_reg, | 670 | uart_add_one_port (&lh7a40x_reg, |
667 | &lh7a40x_ports[i].port); | 671 | &lh7a40x_ports[i].port); |
672 | } | ||
668 | } | 673 | } |
669 | return ret; | 674 | return ret; |
670 | } | 675 | } |