diff options
| author | Jeff Garzik <jeff@garzik.org> | 2006-03-29 19:58:22 -0500 |
|---|---|---|
| committer | Jeff Garzik <jeff@garzik.org> | 2006-03-29 19:58:22 -0500 |
| commit | 79072f38909e3d9883317238887460c39ddcc4cb (patch) | |
| tree | 28369f5a844535ff836565eefd62695b0e890fa3 /drivers/serial/m32r_sio.c | |
| parent | 200d5a7684cc49ef4be40e832daf3f217e70dfbb (diff) | |
| parent | 55d8ca4f8094246da6e71889a4e04bfafaa78b10 (diff) | |
Merge branch 'upstream'
Diffstat (limited to 'drivers/serial/m32r_sio.c')
| -rw-r--r-- | drivers/serial/m32r_sio.c | 41 |
1 files changed, 16 insertions, 25 deletions
diff --git a/drivers/serial/m32r_sio.c b/drivers/serial/m32r_sio.c index 242a04104393..e9c10c0a30fc 100644 --- a/drivers/serial/m32r_sio.c +++ b/drivers/serial/m32r_sio.c | |||
| @@ -248,17 +248,17 @@ static void sio_error(int *status) | |||
| 248 | 248 | ||
| 249 | #endif /* CONFIG_SERIAL_M32R_PLDSIO */ | 249 | #endif /* CONFIG_SERIAL_M32R_PLDSIO */ |
| 250 | 250 | ||
| 251 | static _INLINE_ unsigned int sio_in(struct uart_sio_port *up, int offset) | 251 | static unsigned int sio_in(struct uart_sio_port *up, int offset) |
| 252 | { | 252 | { |
| 253 | return __sio_in(up->port.iobase + offset); | 253 | return __sio_in(up->port.iobase + offset); |
| 254 | } | 254 | } |
| 255 | 255 | ||
| 256 | static _INLINE_ void sio_out(struct uart_sio_port *up, int offset, int value) | 256 | static void sio_out(struct uart_sio_port *up, int offset, int value) |
| 257 | { | 257 | { |
| 258 | __sio_out(value, up->port.iobase + offset); | 258 | __sio_out(value, up->port.iobase + offset); |
| 259 | } | 259 | } |
| 260 | 260 | ||
| 261 | static _INLINE_ unsigned int serial_in(struct uart_sio_port *up, int offset) | 261 | static unsigned int serial_in(struct uart_sio_port *up, int offset) |
| 262 | { | 262 | { |
| 263 | if (!offset) | 263 | if (!offset) |
| 264 | return 0; | 264 | return 0; |
| @@ -266,8 +266,7 @@ static _INLINE_ unsigned int serial_in(struct uart_sio_port *up, int offset) | |||
| 266 | return __sio_in(offset); | 266 | return __sio_in(offset); |
| 267 | } | 267 | } |
| 268 | 268 | ||
| 269 | static _INLINE_ void | 269 | static void serial_out(struct uart_sio_port *up, int offset, int value) |
| 270 | serial_out(struct uart_sio_port *up, int offset, int value) | ||
| 271 | { | 270 | { |
| 272 | if (!offset) | 271 | if (!offset) |
| 273 | return; | 272 | return; |
| @@ -326,8 +325,8 @@ static void m32r_sio_enable_ms(struct uart_port *port) | |||
| 326 | serial_out(up, UART_IER, up->ier); | 325 | serial_out(up, UART_IER, up->ier); |
| 327 | } | 326 | } |
| 328 | 327 | ||
| 329 | static _INLINE_ void receive_chars(struct uart_sio_port *up, int *status, | 328 | static void receive_chars(struct uart_sio_port *up, int *status, |
| 330 | struct pt_regs *regs) | 329 | struct pt_regs *regs) |
| 331 | { | 330 | { |
| 332 | struct tty_struct *tty = up->port.info->tty; | 331 | struct tty_struct *tty = up->port.info->tty; |
| 333 | unsigned char ch; | 332 | unsigned char ch; |
| @@ -400,7 +399,7 @@ static _INLINE_ void receive_chars(struct uart_sio_port *up, int *status, | |||
| 400 | tty_flip_buffer_push(tty); | 399 | tty_flip_buffer_push(tty); |
| 401 | } | 400 | } |
| 402 | 401 | ||
| 403 | static _INLINE_ void transmit_chars(struct uart_sio_port *up) | 402 | static void transmit_chars(struct uart_sio_port *up) |
| 404 | { | 403 | { |
| 405 | struct circ_buf *xmit = &up->port.info->xmit; | 404 | struct circ_buf *xmit = &up->port.info->xmit; |
| 406 | int count; | 405 | int count; |
| @@ -1039,6 +1038,14 @@ static inline void wait_for_xmitr(struct uart_sio_port *up) | |||
| 1039 | } | 1038 | } |
| 1040 | } | 1039 | } |
| 1041 | 1040 | ||
| 1041 | static void m32r_sio_console_putchar(struct uart_port *port, int ch) | ||
| 1042 | { | ||
| 1043 | struct uart_sio_port *up = (struct uart_sio_port *)port; | ||
| 1044 | |||
| 1045 | wait_for_xmitr(up); | ||
| 1046 | sio_out(up, SIOTXB, ch); | ||
| 1047 | } | ||
| 1048 | |||
| 1042 | /* | 1049 | /* |
| 1043 | * Print a string to the serial port trying not to disturb | 1050 | * Print a string to the serial port trying not to disturb |
| 1044 | * any possible real use of the port... | 1051 | * any possible real use of the port... |
| @@ -1058,23 +1065,7 @@ static void m32r_sio_console_write(struct console *co, const char *s, | |||
| 1058 | ier = sio_in(up, SIOTRCR); | 1065 | ier = sio_in(up, SIOTRCR); |
| 1059 | sio_out(up, SIOTRCR, 0); | 1066 | sio_out(up, SIOTRCR, 0); |
| 1060 | 1067 | ||
| 1061 | /* | 1068 | uart_console_write(&up->port, s, count, m32r_sio_console_putchar); |
| 1062 | * Now, do each character | ||
| 1063 | */ | ||
| 1064 | for (i = 0; i < count; i++, s++) { | ||
| 1065 | wait_for_xmitr(up); | ||
| 1066 | |||
| 1067 | /* | ||
| 1068 | * Send the character out. | ||
| 1069 | * If a LF, also do CR... | ||
| 1070 | */ | ||
| 1071 | sio_out(up, SIOTXB, *s); | ||
| 1072 | |||
| 1073 | if (*s == 10) { | ||
| 1074 | wait_for_xmitr(up); | ||
| 1075 | sio_out(up, SIOTXB, 13); | ||
| 1076 | } | ||
| 1077 | } | ||
| 1078 | 1069 | ||
| 1079 | /* | 1070 | /* |
| 1080 | * Finally, wait for transmitter to become empty | 1071 | * Finally, wait for transmitter to become empty |
