Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88092
b: refs/heads/master
c: 39d4c92
h: refs/heads/master
v: v3
  • Loading branch information
Marc Pignat authored and Linus Torvalds committed Apr 2, 2008
1 parent a6bd43f commit 43fbb9f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ba0657ff0527bab83387e19eb98b423fcc290674
refs/heads/master: 39d4c922b596633da86878b1a5cc881785b8e5fa
11 changes: 11 additions & 0 deletions trunk/drivers/serial/atmel_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@

#define UART_PUT_TPR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TPR)
#define UART_PUT_TCR(port,v) __raw_writel(v, (port)->membase + ATMEL_PDC_TCR)
#define UART_GET_TCR(port) __raw_readl((port)->membase + ATMEL_PDC_TCR)

static int (*atmel_open_hook)(struct uart_port *);
static void (*atmel_close_hook)(struct uart_port *);
Expand Down Expand Up @@ -1275,13 +1276,18 @@ static void atmel_console_write(struct console *co, const char *s, u_int count)
{
struct uart_port *port = &atmel_ports[co->index].uart;
unsigned int status, imr;
unsigned int pdc_tx;

/*
* First, save IMR and then disable interrupts
*/
imr = UART_GET_IMR(port);
UART_PUT_IDR(port, ATMEL_US_RXRDY | ATMEL_US_TXRDY);

/* Store PDC transmit status and disable it */
pdc_tx = UART_GET_PTSR(port) & ATMEL_PDC_TXTEN;
UART_PUT_PTCR(port, ATMEL_PDC_TXTDIS);

uart_console_write(port, s, count, atmel_console_putchar);

/*
Expand All @@ -1291,6 +1297,11 @@ static void atmel_console_write(struct console *co, const char *s, u_int count)
do {
status = UART_GET_CSR(port);
} while (!(status & ATMEL_US_TXRDY));

/* Restore PDC transmit status */
if (pdc_tx)
UART_PUT_PTCR(port, ATMEL_PDC_TXTEN);

/* set interrupts back the way they were */
UART_PUT_IER(port, imr);
}
Expand Down

0 comments on commit 43fbb9f

Please sign in to comment.