mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-01 09:13:37 +00:00
[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>
This commit is contained in:
parent
638b266630
commit
fb62c5a704
1 changed files with 9 additions and 4 deletions
|
|
@ -145,14 +145,15 @@ lh7a40xuart_rx_chars (struct uart_port* port)
|
||||||
{
|
{
|
||||||
struct tty_struct* tty = port->info->tty;
|
struct tty_struct* tty = port->info->tty;
|
||||||
int cbRxMax = 256; /* (Gross) limit on receive */
|
int cbRxMax = 256; /* (Gross) limit on receive */
|
||||||
unsigned int data, flag;/* Received data and status */
|
unsigned int data; /* Received data and status */
|
||||||
|
unsigned int flag;
|
||||||
|
|
||||||
while (!(UR (port, UART_R_STATUS) & nRxRdy) && --cbRxMax) {
|
while (!(UR (port, UART_R_STATUS) & nRxRdy) && --cbRxMax) {
|
||||||
data = UR (port, UART_R_DATA);
|
data = UR (port, UART_R_DATA);
|
||||||
flag = TTY_NORMAL;
|
flag = TTY_NORMAL;
|
||||||
++port->icount.rx;
|
++port->icount.rx;
|
||||||
|
|
||||||
if (unlikely(data & RxError)) { /* Quick check, short-circuit */
|
if (unlikely(data & RxError)) {
|
||||||
if (data & RxBreak) {
|
if (data & RxBreak) {
|
||||||
data &= ~(RxFramingError | RxParityError);
|
data &= ~(RxFramingError | RxParityError);
|
||||||
++port->icount.brk;
|
++port->icount.brk;
|
||||||
|
|
@ -303,7 +304,7 @@ static void lh7a40xuart_set_mctrl (struct uart_port* port, unsigned int mctrl)
|
||||||
/* Note, kernel appears to be setting DTR and RTS on console. */
|
/* Note, kernel appears to be setting DTR and RTS on console. */
|
||||||
|
|
||||||
/* *** FIXME: this deserves more work. There's some work in
|
/* *** FIXME: this deserves more work. There's some work in
|
||||||
tracing all of the IO pins. */
|
tracing all of the IO pins. */
|
||||||
#if 0
|
#if 0
|
||||||
if( port->mapbase == UART1_PHYS) {
|
if( port->mapbase == UART1_PHYS) {
|
||||||
gpioRegs_t *gpio = (gpioRegs_t *)IO_ADDRESS(GPIO_PHYS);
|
gpioRegs_t *gpio = (gpioRegs_t *)IO_ADDRESS(GPIO_PHYS);
|
||||||
|
|
@ -662,9 +663,13 @@ static int __init lh7a40xuart_init(void)
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < DEV_NR; i++)
|
for (i = 0; i < DEV_NR; i++) {
|
||||||
|
/* UART3, when used, requires GPIO pin reallocation */
|
||||||
|
if (lh7a40x_ports[i].port.mapbase == UART3_PHYS)
|
||||||
|
GPIO_PINMUX |= 1<<3;
|
||||||
uart_add_one_port (&lh7a40x_reg,
|
uart_add_one_port (&lh7a40x_reg,
|
||||||
&lh7a40x_ports[i].port);
|
&lh7a40x_ports[i].port);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue