diff options
Diffstat (limited to 'drivers/serial/bfin_5xx.c')
-rw-r--r-- | drivers/serial/bfin_5xx.c | 40 |
1 files changed, 10 insertions, 30 deletions
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c index d6b4ead693b7..f20952c43cb8 100644 --- a/drivers/serial/bfin_5xx.c +++ b/drivers/serial/bfin_5xx.c | |||
@@ -530,11 +530,7 @@ static unsigned int bfin_serial_get_mctrl(struct uart_port *port) | |||
530 | if (uart->cts_pin < 0) | 530 | if (uart->cts_pin < 0) |
531 | return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR; | 531 | return TIOCM_CTS | TIOCM_DSR | TIOCM_CAR; |
532 | 532 | ||
533 | # ifdef BF54x | 533 | if (UART_GET_CTS(uart)) |
534 | if (UART_GET_MSR(uart) & CTS) | ||
535 | # else | ||
536 | if (gpio_get_value(uart->cts_pin)) | ||
537 | # endif | ||
538 | return TIOCM_DSR | TIOCM_CAR; | 534 | return TIOCM_DSR | TIOCM_CAR; |
539 | else | 535 | else |
540 | #endif | 536 | #endif |
@@ -549,17 +545,9 @@ static void bfin_serial_set_mctrl(struct uart_port *port, unsigned int mctrl) | |||
549 | return; | 545 | return; |
550 | 546 | ||
551 | if (mctrl & TIOCM_RTS) | 547 | if (mctrl & TIOCM_RTS) |
552 | # ifdef BF54x | 548 | UART_CLEAR_RTS(uart); |
553 | UART_PUT_MCR(uart, UART_GET_MCR(uart) & ~MRTS); | ||
554 | # else | ||
555 | gpio_set_value(uart->rts_pin, 0); | ||
556 | # endif | ||
557 | else | 549 | else |
558 | # ifdef BF54x | 550 | UART_SET_RTS(uart); |
559 | UART_PUT_MCR(uart, UART_GET_MCR(uart) | MRTS); | ||
560 | # else | ||
561 | gpio_set_value(uart->rts_pin, 1); | ||
562 | # endif | ||
563 | #endif | 551 | #endif |
564 | } | 552 | } |
565 | 553 | ||
@@ -752,11 +740,7 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios, | |||
752 | 740 | ||
753 | /* Disable UART */ | 741 | /* Disable UART */ |
754 | ier = UART_GET_IER(uart); | 742 | ier = UART_GET_IER(uart); |
755 | #ifdef CONFIG_BF54x | 743 | UART_DISABLE_INTS(uart); |
756 | UART_CLEAR_IER(uart, 0xF); | ||
757 | #else | ||
758 | UART_PUT_IER(uart, 0); | ||
759 | #endif | ||
760 | 744 | ||
761 | /* Set DLAB in LCR to Access DLL and DLH */ | 745 | /* Set DLAB in LCR to Access DLL and DLH */ |
762 | UART_SET_DLAB(uart); | 746 | UART_SET_DLAB(uart); |
@@ -771,11 +755,7 @@ bfin_serial_set_termios(struct uart_port *port, struct ktermios *termios, | |||
771 | UART_PUT_LCR(uart, lcr); | 755 | UART_PUT_LCR(uart, lcr); |
772 | 756 | ||
773 | /* Enable UART */ | 757 | /* Enable UART */ |
774 | #ifdef CONFIG_BF54x | 758 | UART_ENABLE_INTS(uart, ier); |
775 | UART_SET_IER(uart, ier); | ||
776 | #else | ||
777 | UART_PUT_IER(uart, ier); | ||
778 | #endif | ||
779 | 759 | ||
780 | val = UART_GET_GCTL(uart); | 760 | val = UART_GET_GCTL(uart); |
781 | val |= UCEN; | 761 | val |= UCEN; |
@@ -833,15 +813,15 @@ bfin_serial_verify_port(struct uart_port *port, struct serial_struct *ser) | |||
833 | * Enable the IrDA function if tty->ldisc.num is N_IRDA. | 813 | * Enable the IrDA function if tty->ldisc.num is N_IRDA. |
834 | * In other cases, disable IrDA function. | 814 | * In other cases, disable IrDA function. |
835 | */ | 815 | */ |
836 | static void bfin_set_ldisc(struct tty_struct *tty) | 816 | static void bfin_serial_set_ldisc(struct uart_port *port) |
837 | { | 817 | { |
838 | int line = tty->index; | 818 | int line = port->line; |
839 | unsigned short val; | 819 | unsigned short val; |
840 | 820 | ||
841 | if (line >= tty->driver->num) | 821 | if (line >= port->info->tty->driver->num) |
842 | return; | 822 | return; |
843 | 823 | ||
844 | switch (tty->ldisc.num) { | 824 | switch (port->info->tty->ldisc.num) { |
845 | case N_IRDA: | 825 | case N_IRDA: |
846 | val = UART_GET_GCTL(&bfin_serial_ports[line]); | 826 | val = UART_GET_GCTL(&bfin_serial_ports[line]); |
847 | val |= (IREN | RPOLC); | 827 | val |= (IREN | RPOLC); |
@@ -866,6 +846,7 @@ static struct uart_ops bfin_serial_pops = { | |||
866 | .startup = bfin_serial_startup, | 846 | .startup = bfin_serial_startup, |
867 | .shutdown = bfin_serial_shutdown, | 847 | .shutdown = bfin_serial_shutdown, |
868 | .set_termios = bfin_serial_set_termios, | 848 | .set_termios = bfin_serial_set_termios, |
849 | .set_ldisc = bfin_serial_set_ldisc, | ||
869 | .type = bfin_serial_type, | 850 | .type = bfin_serial_type, |
870 | .release_port = bfin_serial_release_port, | 851 | .release_port = bfin_serial_release_port, |
871 | .request_port = bfin_serial_request_port, | 852 | .request_port = bfin_serial_request_port, |
@@ -1206,7 +1187,6 @@ static int __init bfin_serial_init(void) | |||
1206 | 1187 | ||
1207 | ret = uart_register_driver(&bfin_serial_reg); | 1188 | ret = uart_register_driver(&bfin_serial_reg); |
1208 | if (ret == 0) { | 1189 | if (ret == 0) { |
1209 | bfin_serial_reg.tty_driver->set_ldisc = bfin_set_ldisc; | ||
1210 | ret = platform_driver_register(&bfin_serial_driver); | 1190 | ret = platform_driver_register(&bfin_serial_driver); |
1211 | if (ret) { | 1191 | if (ret) { |
1212 | pr_debug("uart register failed\n"); | 1192 | pr_debug("uart register failed\n"); |