aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2008-02-02 01:29:25 -0500
committerBryan Wu <cooloney@kernel.org>2008-02-02 01:29:25 -0500
commit4cb4f22b19237e63c460c53fbd1c417cdaf63014 (patch)
tree6c5f6630af999a1e45241f6e8ee8e262d815a2c1 /drivers
parent095455682e29dbbc9f93ad83db459df524524992 (diff)
[Blackfin] serial driver: Fix bug Poll RTS/CTS status in DMA mode as well
https://blackfin.uclinux.org/gf/project/uclinux-dist/tracker/?action=TrackerItemEdit&tracker_item_id=3858 Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/bfin_5xx.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/drivers/serial/bfin_5xx.c b/drivers/serial/bfin_5xx.c
index a07df539e525..af866ab3f5a1 100644
--- a/drivers/serial/bfin_5xx.c
+++ b/drivers/serial/bfin_5xx.c
@@ -53,7 +53,6 @@
53#ifdef CONFIG_SERIAL_BFIN_DMA 53#ifdef CONFIG_SERIAL_BFIN_DMA
54static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart); 54static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart);
55#else 55#else
56static void bfin_serial_do_work(struct work_struct *work);
57static void bfin_serial_tx_chars(struct bfin_serial_port *uart); 56static void bfin_serial_tx_chars(struct bfin_serial_port *uart);
58#endif 57#endif
59 58
@@ -372,8 +371,9 @@ static irqreturn_t bfin_serial_tx_int(int irq, void *dev_id)
372 371
373 return IRQ_HANDLED; 372 return IRQ_HANDLED;
374} 373}
374#endif
375 375
376 376#ifdef CONFIG_SERIAL_BFIN_CTSRTS
377static void bfin_serial_do_work(struct work_struct *work) 377static void bfin_serial_do_work(struct work_struct *work)
378{ 378{
379 struct bfin_serial_port *uart = container_of(work, struct bfin_serial_port, cts_workqueue); 379 struct bfin_serial_port *uart = container_of(work, struct bfin_serial_port, cts_workqueue);
@@ -607,22 +607,17 @@ static void bfin_serial_mctrl_check(struct bfin_serial_port *uart)
607{ 607{
608#ifdef CONFIG_SERIAL_BFIN_CTSRTS 608#ifdef CONFIG_SERIAL_BFIN_CTSRTS
609 unsigned int status; 609 unsigned int status;
610# ifdef CONFIG_SERIAL_BFIN_DMA
611 struct uart_info *info = uart->port.info; 610 struct uart_info *info = uart->port.info;
612 struct tty_struct *tty = info->tty; 611 struct tty_struct *tty = info->tty;
613 612
614 status = bfin_serial_get_mctrl(&uart->port); 613 status = bfin_serial_get_mctrl(&uart->port);
614 uart_handle_cts_change(&uart->port, status & TIOCM_CTS);
615 if (!(status & TIOCM_CTS)) { 615 if (!(status & TIOCM_CTS)) {
616 tty->hw_stopped = 1; 616 tty->hw_stopped = 1;
617 schedule_work(&uart->cts_workqueue);
617 } else { 618 } else {
618 tty->hw_stopped = 0; 619 tty->hw_stopped = 0;
619 } 620 }
620# else
621 status = bfin_serial_get_mctrl(&uart->port);
622 uart_handle_cts_change(&uart->port, status & TIOCM_CTS);
623 if (!(status & TIOCM_CTS))
624 schedule_work(&uart->cts_workqueue);
625# endif
626#endif 621#endif
627} 622}
628 623
@@ -939,10 +934,9 @@ static void __init bfin_serial_init_ports(void)
939 bfin_serial_ports[i].rx_dma_channel = 934 bfin_serial_ports[i].rx_dma_channel =
940 bfin_serial_resource[i].uart_rx_dma_channel; 935 bfin_serial_resource[i].uart_rx_dma_channel;
941 init_timer(&(bfin_serial_ports[i].rx_dma_timer)); 936 init_timer(&(bfin_serial_ports[i].rx_dma_timer));
942#else
943 INIT_WORK(&bfin_serial_ports[i].cts_workqueue, bfin_serial_do_work);
944#endif 937#endif
945#ifdef CONFIG_SERIAL_BFIN_CTSRTS 938#ifdef CONFIG_SERIAL_BFIN_CTSRTS
939 INIT_WORK(&bfin_serial_ports[i].cts_workqueue, bfin_serial_do_work);
946 bfin_serial_ports[i].cts_pin = 940 bfin_serial_ports[i].cts_pin =
947 bfin_serial_resource[i].uart_cts_pin; 941 bfin_serial_resource[i].uart_cts_pin;
948 bfin_serial_ports[i].rts_pin = 942 bfin_serial_ports[i].rts_pin =