Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fb62c5a7 authored by Marc Singer's avatar Marc Singer Committed by Russell King
Browse files

[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: default avatarMarc Singer <elf@buici.com>
Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent 638b2666
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -145,14 +145,15 @@ lh7a40xuart_rx_chars (struct uart_port* port)
{
	struct tty_struct* tty = port->info->tty;
	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) {
		data = UR (port, UART_R_DATA);
		flag = TTY_NORMAL;
		++port->icount.rx;

		if (unlikely(data & RxError)) {	/* Quick check, short-circuit */
		if (unlikely(data & RxError)) {
			if (data & RxBreak) {
				data &= ~(RxFramingError | RxParityError);
				++port->icount.brk;
@@ -662,10 +663,14 @@ static int __init lh7a40xuart_init(void)
	if (ret == 0) {
		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,
					   &lh7a40x_ports[i].port);
		}
	}
	return ret;
}