Commit eefadcbc authored by Uwe Kleine-König's avatar Uwe Kleine-König Committed by Greg Kroah-Hartman

serial: altera: set RRDY flag also without irq

The UART can be operated without an irq. In this case a timer is setup
that regularily calls altera_uart_interrupt(). The receiving part
depends on pp->imr having the bit ALTERA_UART_STATUS_RRDY_MSK set,
otherwise altera_uart_rx_chars() is never called. So ensure that the bit
gets set (disguised as ALTERA_UART_CONTROL_RRDY_MSK) by not returning
early from altera_uart_startup() if port->irq is 0.

This doesn't affect the hardware as the ALTERA_UART_CONTROL_RRDY_MSK bit
isn't actually written to the control register.
Signed-off-by: default avatarUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: default avatarTobias Klauser <tklauser@distanz.ch>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2ea6ad8b
......@@ -321,13 +321,12 @@ static int altera_uart_startup(struct uart_port *port)
{
struct altera_uart *pp = container_of(port, struct altera_uart, port);
unsigned long flags;
int ret;
if (!port->irq) {
timer_setup(&pp->tmr, altera_uart_timer, 0);
mod_timer(&pp->tmr, jiffies + uart_poll_timeout(port));
return 0;
}
} else {
int ret;
ret = request_irq(port->irq, altera_uart_interrupt, 0,
DRV_NAME, port);
......@@ -336,6 +335,7 @@ static int altera_uart_startup(struct uart_port *port)
"interrupt vector=%d\n", port->line, port->irq);
return ret;
}
}
spin_lock_irqsave(&port->lock, flags);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment