diff options
Diffstat (limited to 'drivers/serial/dz.c')
-rw-r--r-- | drivers/serial/dz.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/serial/dz.c b/drivers/serial/dz.c index 0dddd68b20d2..6042b87797a1 100644 --- a/drivers/serial/dz.c +++ b/drivers/serial/dz.c | |||
@@ -197,7 +197,7 @@ static inline void dz_receive_chars(struct dz_mux *mux) | |||
197 | while ((status = dz_in(dport, DZ_RBUF)) & DZ_DVAL) { | 197 | while ((status = dz_in(dport, DZ_RBUF)) & DZ_DVAL) { |
198 | dport = &mux->dport[LINE(status)]; | 198 | dport = &mux->dport[LINE(status)]; |
199 | uport = &dport->port; | 199 | uport = &dport->port; |
200 | tty = uport->info->tty; /* point to the proper dev */ | 200 | tty = uport->info->port.tty; /* point to the proper dev */ |
201 | 201 | ||
202 | ch = UCHAR(status); /* grab the char */ | 202 | ch = UCHAR(status); /* grab the char */ |
203 | flag = TTY_NORMAL; | 203 | flag = TTY_NORMAL; |
@@ -249,7 +249,7 @@ static inline void dz_receive_chars(struct dz_mux *mux) | |||
249 | } | 249 | } |
250 | for (i = 0; i < DZ_NB_PORT; i++) | 250 | for (i = 0; i < DZ_NB_PORT; i++) |
251 | if (lines_rx[i]) | 251 | if (lines_rx[i]) |
252 | tty_flip_buffer_push(mux->dport[i].port.info->tty); | 252 | tty_flip_buffer_push(mux->dport[i].port.info->port.tty); |
253 | } | 253 | } |
254 | 254 | ||
255 | /* | 255 | /* |
@@ -642,6 +642,26 @@ static void dz_set_termios(struct uart_port *uport, struct ktermios *termios, | |||
642 | spin_unlock_irqrestore(&dport->port.lock, flags); | 642 | spin_unlock_irqrestore(&dport->port.lock, flags); |
643 | } | 643 | } |
644 | 644 | ||
645 | /* | ||
646 | * Hack alert! | ||
647 | * Required solely so that the initial PROM-based console | ||
648 | * works undisturbed in parallel with this one. | ||
649 | */ | ||
650 | static void dz_pm(struct uart_port *uport, unsigned int state, | ||
651 | unsigned int oldstate) | ||
652 | { | ||
653 | struct dz_port *dport = to_dport(uport); | ||
654 | unsigned long flags; | ||
655 | |||
656 | spin_lock_irqsave(&dport->port.lock, flags); | ||
657 | if (state < 3) | ||
658 | dz_start_tx(&dport->port); | ||
659 | else | ||
660 | dz_stop_tx(&dport->port); | ||
661 | spin_unlock_irqrestore(&dport->port.lock, flags); | ||
662 | } | ||
663 | |||
664 | |||
645 | static const char *dz_type(struct uart_port *uport) | 665 | static const char *dz_type(struct uart_port *uport) |
646 | { | 666 | { |
647 | return "DZ"; | 667 | return "DZ"; |
@@ -738,6 +758,7 @@ static struct uart_ops dz_ops = { | |||
738 | .startup = dz_startup, | 758 | .startup = dz_startup, |
739 | .shutdown = dz_shutdown, | 759 | .shutdown = dz_shutdown, |
740 | .set_termios = dz_set_termios, | 760 | .set_termios = dz_set_termios, |
761 | .pm = dz_pm, | ||
741 | .type = dz_type, | 762 | .type = dz_type, |
742 | .release_port = dz_release_port, | 763 | .release_port = dz_release_port, |
743 | .request_port = dz_request_port, | 764 | .request_port = dz_request_port, |
@@ -861,7 +882,10 @@ static int __init dz_console_setup(struct console *co, char *options) | |||
861 | if (ret) | 882 | if (ret) |
862 | return ret; | 883 | return ret; |
863 | 884 | ||
885 | spin_lock_init(&dport->port.lock); /* For dz_pm(). */ | ||
886 | |||
864 | dz_reset(dport); | 887 | dz_reset(dport); |
888 | dz_pm(uport, 0, -1); | ||
865 | 889 | ||
866 | if (options) | 890 | if (options) |
867 | uart_parse_options(options, &baud, &parity, &bits, &flow); | 891 | uart_parse_options(options, &baud, &parity, &bits, &flow); |