aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/sunsu.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-23 23:44:19 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-03-23 23:44:19 -0500
commit1ebbe2b20091d306453a5cf480a87e6cd28ae76f (patch)
treef5cd7a0fa69b8b1938cb5a0faed2e7b0628072a5 /drivers/serial/sunsu.c
parentac58c9059da8886b5e8cde012a80266b18ca146e (diff)
parent674a396c6d2ba0341ebdd7c1c9950f32f018e2dd (diff)
Merge branch 'linus'
Diffstat (limited to 'drivers/serial/sunsu.c')
-rw-r--r--drivers/serial/sunsu.c39
1 files changed, 14 insertions, 25 deletions
diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c
index 46c44b83f57c..9fe2283d91e5 100644
--- a/drivers/serial/sunsu.c
+++ b/drivers/serial/sunsu.c
@@ -102,9 +102,7 @@ struct uart_sunsu_port {
102#endif 102#endif
103}; 103};
104 104
105#define _INLINE_ 105static unsigned int serial_in(struct uart_sunsu_port *up, int offset)
106
107static _INLINE_ unsigned int serial_in(struct uart_sunsu_port *up, int offset)
108{ 106{
109 offset <<= up->port.regshift; 107 offset <<= up->port.regshift;
110 108
@@ -121,8 +119,7 @@ static _INLINE_ unsigned int serial_in(struct uart_sunsu_port *up, int offset)
121 } 119 }
122} 120}
123 121
124static _INLINE_ void 122static void serial_out(struct uart_sunsu_port *up, int offset, int value)
125serial_out(struct uart_sunsu_port *up, int offset, int value)
126{ 123{
127#ifndef CONFIG_SPARC64 124#ifndef CONFIG_SPARC64
128 /* 125 /*
@@ -316,7 +313,7 @@ static void sunsu_enable_ms(struct uart_port *port)
316 spin_unlock_irqrestore(&up->port.lock, flags); 313 spin_unlock_irqrestore(&up->port.lock, flags);
317} 314}
318 315
319static _INLINE_ struct tty_struct * 316static struct tty_struct *
320receive_chars(struct uart_sunsu_port *up, unsigned char *status, struct pt_regs *regs) 317receive_chars(struct uart_sunsu_port *up, unsigned char *status, struct pt_regs *regs)
321{ 318{
322 struct tty_struct *tty = up->port.info->tty; 319 struct tty_struct *tty = up->port.info->tty;
@@ -395,7 +392,7 @@ receive_chars(struct uart_sunsu_port *up, unsigned char *status, struct pt_regs
395 return tty; 392 return tty;
396} 393}
397 394
398static _INLINE_ void transmit_chars(struct uart_sunsu_port *up) 395static void transmit_chars(struct uart_sunsu_port *up)
399{ 396{
400 struct circ_buf *xmit = &up->port.info->xmit; 397 struct circ_buf *xmit = &up->port.info->xmit;
401 int count; 398 int count;
@@ -431,7 +428,7 @@ static _INLINE_ void transmit_chars(struct uart_sunsu_port *up)
431 __stop_tx(up); 428 __stop_tx(up);
432} 429}
433 430
434static _INLINE_ void check_modem_status(struct uart_sunsu_port *up) 431static void check_modem_status(struct uart_sunsu_port *up)
435{ 432{
436 int status; 433 int status;
437 434
@@ -1377,6 +1374,14 @@ static __inline__ void wait_for_xmitr(struct uart_sunsu_port *up)
1377 } 1374 }
1378} 1375}
1379 1376
1377static void sunsu_console_putchar(struct uart_port *port, int ch)
1378{
1379 struct uart_sunsu_port *up = (struct uart_sunsu_port *)port;
1380
1381 wait_for_xmitr(up);
1382 serial_out(up, UART_TX, ch);
1383}
1384
1380/* 1385/*
1381 * Print a string to the serial port trying not to disturb 1386 * Print a string to the serial port trying not to disturb
1382 * any possible real use of the port... 1387 * any possible real use of the port...
@@ -1386,7 +1391,6 @@ static void sunsu_console_write(struct console *co, const char *s,
1386{ 1391{
1387 struct uart_sunsu_port *up = &sunsu_ports[co->index]; 1392 struct uart_sunsu_port *up = &sunsu_ports[co->index];
1388 unsigned int ier; 1393 unsigned int ier;
1389 int i;
1390 1394
1391 /* 1395 /*
1392 * First save the UER then disable the interrupts 1396 * First save the UER then disable the interrupts
@@ -1394,22 +1398,7 @@ static void sunsu_console_write(struct console *co, const char *s,
1394 ier = serial_in(up, UART_IER); 1398 ier = serial_in(up, UART_IER);
1395 serial_out(up, UART_IER, 0); 1399 serial_out(up, UART_IER, 0);
1396 1400
1397 /* 1401 uart_console_write(&up->port, s, count, sunsu_console_putchar);
1398 * Now, do each character
1399 */
1400 for (i = 0; i < count; i++, s++) {
1401 wait_for_xmitr(up);
1402
1403 /*
1404 * Send the character out.
1405 * If a LF, also do CR...
1406 */
1407 serial_out(up, UART_TX, *s);
1408 if (*s == 10) {
1409 wait_for_xmitr(up);
1410 serial_out(up, UART_TX, 13);
1411 }
1412 }
1413 1402
1414 /* 1403 /*
1415 * Finally, wait for transmitter to become empty 1404 * Finally, wait for transmitter to become empty