diff options
| author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-23 23:44:19 -0500 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2006-03-23 23:44:19 -0500 |
| commit | 1ebbe2b20091d306453a5cf480a87e6cd28ae76f (patch) | |
| tree | f5cd7a0fa69b8b1938cb5a0faed2e7b0628072a5 /drivers/serial/sa1100.c | |
| parent | ac58c9059da8886b5e8cde012a80266b18ca146e (diff) | |
| parent | 674a396c6d2ba0341ebdd7c1c9950f32f018e2dd (diff) | |
Merge branch 'linus'
Diffstat (limited to 'drivers/serial/sa1100.c')
| -rw-r--r-- | drivers/serial/sa1100.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c index 2c00b8625852..c2d9068b491d 100644 --- a/drivers/serial/sa1100.c +++ b/drivers/serial/sa1100.c | |||
| @@ -689,6 +689,14 @@ void __init sa1100_register_uart(int idx, int port) | |||
| 689 | 689 | ||
| 690 | 690 | ||
| 691 | #ifdef CONFIG_SERIAL_SA1100_CONSOLE | 691 | #ifdef CONFIG_SERIAL_SA1100_CONSOLE |
| 692 | static void sa1100_console_putchar(struct uart_port *port, int ch) | ||
| 693 | { | ||
| 694 | struct sa1100_port *sport = (struct sa1100_port *)port; | ||
| 695 | |||
| 696 | while (!(UART_GET_UTSR1(sport) & UTSR1_TNF)) | ||
| 697 | barrier(); | ||
| 698 | UART_PUT_CHAR(sport, ch); | ||
| 699 | } | ||
| 692 | 700 | ||
| 693 | /* | 701 | /* |
| 694 | * Interrupts are disabled on entering | 702 | * Interrupts are disabled on entering |
| @@ -697,7 +705,7 @@ static void | |||
| 697 | sa1100_console_write(struct console *co, const char *s, unsigned int count) | 705 | sa1100_console_write(struct console *co, const char *s, unsigned int count) |
| 698 | { | 706 | { |
| 699 | struct sa1100_port *sport = &sa1100_ports[co->index]; | 707 | struct sa1100_port *sport = &sa1100_ports[co->index]; |
| 700 | unsigned int old_utcr3, status, i; | 708 | unsigned int old_utcr3, status; |
| 701 | 709 | ||
| 702 | /* | 710 | /* |
| 703 | * First, save UTCR3 and then disable interrupts | 711 | * First, save UTCR3 and then disable interrupts |
| @@ -706,21 +714,7 @@ sa1100_console_write(struct console *co, const char *s, unsigned int count) | |||
| 706 | UART_PUT_UTCR3(sport, (old_utcr3 & ~(UTCR3_RIE | UTCR3_TIE)) | | 714 | UART_PUT_UTCR3(sport, (old_utcr3 & ~(UTCR3_RIE | UTCR3_TIE)) | |
| 707 | UTCR3_TXE); | 715 | UTCR3_TXE); |
| 708 | 716 | ||
| 709 | /* | 717 | uart_console_write(&sport->port, s, count, sa1100_console_putchar); |
| 710 | * Now, do each character | ||
| 711 | */ | ||
| 712 | for (i = 0; i < count; i++) { | ||
| 713 | do { | ||
| 714 | status = UART_GET_UTSR1(sport); | ||
| 715 | } while (!(status & UTSR1_TNF)); | ||
| 716 | UART_PUT_CHAR(sport, s[i]); | ||
| 717 | if (s[i] == '\n') { | ||
| 718 | do { | ||
| 719 | status = UART_GET_UTSR1(sport); | ||
| 720 | } while (!(status & UTSR1_TNF)); | ||
| 721 | UART_PUT_CHAR(sport, '\r'); | ||
| 722 | } | ||
| 723 | } | ||
| 724 | 718 | ||
| 725 | /* | 719 | /* |
| 726 | * Finally, wait for transmitter to become empty | 720 | * Finally, wait for transmitter to become empty |
