diff options
Diffstat (limited to 'drivers/serial/pnx8xxx_uart.c')
-rw-r--r-- | drivers/serial/pnx8xxx_uart.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/serial/pnx8xxx_uart.c b/drivers/serial/pnx8xxx_uart.c index 22e30d21225e..1bb8f1b45767 100644 --- a/drivers/serial/pnx8xxx_uart.c +++ b/drivers/serial/pnx8xxx_uart.c | |||
@@ -187,7 +187,7 @@ static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport) | |||
187 | status = FIFO_TO_SM(serial_in(sport, PNX8XXX_FIFO)) | | 187 | status = FIFO_TO_SM(serial_in(sport, PNX8XXX_FIFO)) | |
188 | ISTAT_TO_SM(serial_in(sport, PNX8XXX_ISTAT)); | 188 | ISTAT_TO_SM(serial_in(sport, PNX8XXX_ISTAT)); |
189 | while (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFIFO)) { | 189 | while (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFIFO)) { |
190 | ch = serial_in(sport, PNX8XXX_FIFO); | 190 | ch = serial_in(sport, PNX8XXX_FIFO) & 0xff; |
191 | 191 | ||
192 | sport->port.icount.rx++; | 192 | sport->port.icount.rx++; |
193 | 193 | ||
@@ -198,9 +198,16 @@ static void pnx8xxx_rx_chars(struct pnx8xxx_port *sport) | |||
198 | * out of the main execution path | 198 | * out of the main execution path |
199 | */ | 199 | */ |
200 | if (status & (FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE | | 200 | if (status & (FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE | |
201 | PNX8XXX_UART_FIFO_RXPAR) | | 201 | PNX8XXX_UART_FIFO_RXPAR | |
202 | PNX8XXX_UART_FIFO_RXBRK) | | ||
202 | ISTAT_TO_SM(PNX8XXX_UART_INT_RXOVRN))) { | 203 | ISTAT_TO_SM(PNX8XXX_UART_INT_RXOVRN))) { |
203 | if (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXPAR)) | 204 | if (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXBRK)) { |
205 | status &= ~(FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE) | | ||
206 | FIFO_TO_SM(PNX8XXX_UART_FIFO_RXPAR)); | ||
207 | sport->port.icount.brk++; | ||
208 | if (uart_handle_break(&sport->port)) | ||
209 | goto ignore_char; | ||
210 | } else if (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXPAR)) | ||
204 | sport->port.icount.parity++; | 211 | sport->port.icount.parity++; |
205 | else if (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE)) | 212 | else if (status & FIFO_TO_SM(PNX8XXX_UART_FIFO_RXFE)) |
206 | sport->port.icount.frame++; | 213 | sport->port.icount.frame++; |
@@ -284,14 +291,8 @@ static irqreturn_t pnx8xxx_int(int irq, void *dev_id) | |||
284 | /* Get the interrupts */ | 291 | /* Get the interrupts */ |
285 | status = serial_in(sport, PNX8XXX_ISTAT) & serial_in(sport, PNX8XXX_IEN); | 292 | status = serial_in(sport, PNX8XXX_ISTAT) & serial_in(sport, PNX8XXX_IEN); |
286 | 293 | ||
287 | /* Break signal received */ | 294 | /* Byte or break signal received */ |
288 | if (status & PNX8XXX_UART_INT_BREAK) { | 295 | if (status & (PNX8XXX_UART_INT_RX | PNX8XXX_UART_INT_BREAK)) |
289 | sport->port.icount.brk++; | ||
290 | uart_handle_break(&sport->port); | ||
291 | } | ||
292 | |||
293 | /* Byte received */ | ||
294 | if (status & PNX8XXX_UART_INT_RX) | ||
295 | pnx8xxx_rx_chars(sport); | 296 | pnx8xxx_rx_chars(sport); |
296 | 297 | ||
297 | /* TX holding register empty - transmit a byte */ | 298 | /* TX holding register empty - transmit a byte */ |