aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2008-11-19 00:10:32 -0500
committerPaul Mackerras <paulus@samba.org>2008-11-19 00:10:32 -0500
commitcea555d384b85271035814c5adad23e6c7fc5d2a (patch)
tree1181b6333a69a135293ec75f8a48c849ee32c015 /drivers/serial
parent78608dd32ce46789e970d6c3c423cd668c138d6c (diff)
parent7f0f598a0069d1ab072375965a4b69137233169c (diff)
Merge branch 'linux-2.6' into next
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/sh-sci.c22
-rw-r--r--drivers/serial/sh-sci.h16
2 files changed, 20 insertions, 18 deletions
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c
index 5c0f32c7fbf6..165fc010978c 100644
--- a/drivers/serial/sh-sci.c
+++ b/drivers/serial/sh-sci.c
@@ -144,9 +144,9 @@ static void put_char(struct uart_port *port, char c)
144 status = sci_in(port, SCxSR); 144 status = sci_in(port, SCxSR);
145 } while (!(status & SCxSR_TDxE(port))); 145 } while (!(status & SCxSR_TDxE(port)));
146 146
147 sci_out(port, SCxTDR, c);
148 sci_in(port, SCxSR); /* Dummy read */ 147 sci_in(port, SCxSR); /* Dummy read */
149 sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); 148 sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port));
149 sci_out(port, SCxTDR, c);
150 150
151 spin_unlock_irqrestore(&port->lock, flags); 151 spin_unlock_irqrestore(&port->lock, flags);
152} 152}
@@ -478,10 +478,10 @@ static void sci_transmit_chars(struct uart_port *port)
478 return; 478 return;
479 } 479 }
480 480
481 if (port->type == PORT_SCIF) 481 if (port->type == PORT_SCI)
482 count = scif_txroom(port);
483 else
484 count = sci_txroom(port); 482 count = sci_txroom(port);
483 else
484 count = scif_txroom(port);
485 485
486 do { 486 do {
487 unsigned char c; 487 unsigned char c;
@@ -510,7 +510,7 @@ static void sci_transmit_chars(struct uart_port *port)
510 } else { 510 } else {
511 ctrl = sci_in(port, SCSCR); 511 ctrl = sci_in(port, SCSCR);
512 512
513 if (port->type == PORT_SCIF) { 513 if (port->type != PORT_SCI) {
514 sci_in(port, SCxSR); /* Dummy read */ 514 sci_in(port, SCxSR); /* Dummy read */
515 sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port)); 515 sci_out(port, SCxSR, SCxSR_TDxE_CLEAR(port));
516 } 516 }
@@ -536,10 +536,10 @@ static inline void sci_receive_chars(struct uart_port *port)
536 return; 536 return;
537 537
538 while (1) { 538 while (1) {
539 if (port->type == PORT_SCIF) 539 if (port->type == PORT_SCI)
540 count = scif_rxroom(port);
541 else
542 count = sci_rxroom(port); 540 count = sci_rxroom(port);
541 else
542 count = scif_rxroom(port);
543 543
544 /* Don't copy more bytes than there is room for in the buffer */ 544 /* Don't copy more bytes than there is room for in the buffer */
545 count = tty_buffer_request_room(tty, count); 545 count = tty_buffer_request_room(tty, count);
@@ -714,7 +714,7 @@ static inline int sci_handle_breaks(struct uart_port *port)
714 714
715#if defined(SCIF_ORER) 715#if defined(SCIF_ORER)
716 /* XXX: Handle SCIF overrun error */ 716 /* XXX: Handle SCIF overrun error */
717 if (port->type == PORT_SCIF && (sci_in(port, SCLSR) & SCIF_ORER) != 0) { 717 if (port->type != PORT_SCI && (sci_in(port, SCLSR) & SCIF_ORER) != 0) {
718 sci_out(port, SCLSR, 0); 718 sci_out(port, SCLSR, 0);
719 if (tty_insert_flip_char(tty, 0, TTY_OVERRUN)) { 719 if (tty_insert_flip_char(tty, 0, TTY_OVERRUN)) {
720 copied++; 720 copied++;
@@ -1042,7 +1042,7 @@ static void sci_set_termios(struct uart_port *port, struct ktermios *termios,
1042 1042
1043 sci_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */ 1043 sci_out(port, SCSCR, 0x00); /* TE=0, RE=0, CKE1=0 */
1044 1044
1045 if (port->type == PORT_SCIF) 1045 if (port->type != PORT_SCI)
1046 sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST); 1046 sci_out(port, SCFCR, SCFCR_RFRST | SCFCR_TFRST);
1047 1047
1048 smr_val = sci_in(port, SCSMR) & 3; 1048 smr_val = sci_in(port, SCSMR) & 3;
@@ -1085,6 +1085,7 @@ static const char *sci_type(struct uart_port *port)
1085 case PORT_SCI: return "sci"; 1085 case PORT_SCI: return "sci";
1086 case PORT_SCIF: return "scif"; 1086 case PORT_SCIF: return "scif";
1087 case PORT_IRDA: return "irda"; 1087 case PORT_IRDA: return "irda";
1088 case PORT_SCIFA: return "scifa";
1088 } 1089 }
1089 1090
1090 return NULL; 1091 return NULL;
@@ -1112,6 +1113,7 @@ static void sci_config_port(struct uart_port *port, int flags)
1112 s->init_pins = sci_init_pins_sci; 1113 s->init_pins = sci_init_pins_sci;
1113 break; 1114 break;
1114 case PORT_SCIF: 1115 case PORT_SCIF:
1116 case PORT_SCIFA:
1115 s->init_pins = sci_init_pins_scif; 1117 s->init_pins = sci_init_pins_scif;
1116 break; 1118 break;
1117 case PORT_IRDA: 1119 case PORT_IRDA:
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h
index 6163a45f968f..9f33b064172e 100644
--- a/drivers/serial/sh-sci.h
+++ b/drivers/serial/sh-sci.h
@@ -289,18 +289,18 @@
289#define CPU_SCIx_FNS(name, sci_offset, sci_size, scif_offset, scif_size)\ 289#define CPU_SCIx_FNS(name, sci_offset, sci_size, scif_offset, scif_size)\
290 static inline unsigned int sci_##name##_in(struct uart_port *port) \ 290 static inline unsigned int sci_##name##_in(struct uart_port *port) \
291 { \ 291 { \
292 if (port->type == PORT_SCI) { \ 292 if (port->type == PORT_SCIF) { \
293 SCI_IN(sci_size, sci_offset) \ 293 SCI_IN(scif_size, scif_offset) \
294 } else { \ 294 } else { /* PORT_SCI or PORT_SCIFA */ \
295 SCI_IN(scif_size, scif_offset); \ 295 SCI_IN(sci_size, sci_offset); \
296 } \ 296 } \
297 } \ 297 } \
298 static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \ 298 static inline void sci_##name##_out(struct uart_port *port, unsigned int value) \
299 { \ 299 { \
300 if (port->type == PORT_SCI) { \ 300 if (port->type == PORT_SCIF) { \
301 SCI_OUT(sci_size, sci_offset, value) \ 301 SCI_OUT(scif_size, scif_offset, value) \
302 } else { \ 302 } else { /* PORT_SCI or PORT_SCIFA */ \
303 SCI_OUT(scif_size, scif_offset, value); \ 303 SCI_OUT(sci_size, sci_offset, value); \
304 } \ 304 } \
305 } 305 }
306 306