]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[Blackfin] serial driver: Fix bug Poll RTS/CTS status in DMA mode as well
authorSonic Zhang <sonic.zhang@analog.com>
Sat, 2 Feb 2008 06:29:25 +0000 (14:29 +0800)
committerBryan Wu <cooloney@kernel.org>
Sat, 2 Feb 2008 06:29:25 +0000 (14:29 +0800)
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>
drivers/serial/bfin_5xx.c
include/asm-blackfin/mach-bf527/bfin_serial_5xx.h
include/asm-blackfin/mach-bf533/bfin_serial_5xx.h
include/asm-blackfin/mach-bf537/bfin_serial_5xx.h
include/asm-blackfin/mach-bf548/bfin_serial_5xx.h
include/asm-blackfin/mach-bf561/bfin_serial_5xx.h

index a07df539e5253243df1325a6244a9bed6bbdc925..af866ab3f5a1611264b633abe6c60036a0aef355 100644 (file)
@@ -53,7 +53,6 @@
 #ifdef CONFIG_SERIAL_BFIN_DMA
 static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart);
 #else
-static void bfin_serial_do_work(struct work_struct *work);
 static void bfin_serial_tx_chars(struct bfin_serial_port *uart);
 #endif
 
@@ -372,8 +371,9 @@ static irqreturn_t bfin_serial_tx_int(int irq, void *dev_id)
 
        return IRQ_HANDLED;
 }
+#endif
 
-
+#ifdef CONFIG_SERIAL_BFIN_CTSRTS
 static void bfin_serial_do_work(struct work_struct *work)
 {
        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)
 {
 #ifdef CONFIG_SERIAL_BFIN_CTSRTS
        unsigned int status;
-# ifdef CONFIG_SERIAL_BFIN_DMA
        struct uart_info *info = uart->port.info;
        struct tty_struct *tty = info->tty;
 
        status = bfin_serial_get_mctrl(&uart->port);
+       uart_handle_cts_change(&uart->port, status & TIOCM_CTS);
        if (!(status & TIOCM_CTS)) {
                tty->hw_stopped = 1;
+               schedule_work(&uart->cts_workqueue);
        } else {
                tty->hw_stopped = 0;
        }
-# else
-       status = bfin_serial_get_mctrl(&uart->port);
-       uart_handle_cts_change(&uart->port, status & TIOCM_CTS);
-       if (!(status & TIOCM_CTS))
-               schedule_work(&uart->cts_workqueue);
-# endif
 #endif
 }
 
@@ -939,10 +934,9 @@ static void __init bfin_serial_init_ports(void)
                bfin_serial_ports[i].rx_dma_channel =
                        bfin_serial_resource[i].uart_rx_dma_channel;
                init_timer(&(bfin_serial_ports[i].rx_dma_timer));
-#else
-               INIT_WORK(&bfin_serial_ports[i].cts_workqueue, bfin_serial_do_work);
 #endif
 #ifdef CONFIG_SERIAL_BFIN_CTSRTS
+               INIT_WORK(&bfin_serial_ports[i].cts_workqueue, bfin_serial_do_work);
                bfin_serial_ports[i].cts_pin        =
                        bfin_serial_resource[i].uart_cts_pin;
                bfin_serial_ports[i].rts_pin        =
index 233c585efc1ef055d2689e0c38df3323bfbeee68..c0694ecd2ecde47ecb91b99c43e26bed588d28f2 100644 (file)
@@ -67,10 +67,9 @@ struct bfin_serial_port {
        unsigned int tx_dma_channel;
        unsigned int rx_dma_channel;
        struct work_struct tx_dma_workqueue;
-#else
-       struct work_struct cts_workqueue;
 #endif
 #ifdef CONFIG_SERIAL_BFIN_CTSRTS
+       struct work_struct cts_workqueue;
        int cts_pin;
        int rts_pin;
 #endif
index a1b4f4eebd069e28b426b1ae31da8adf11ffbcf3..b6f513bee56ece582d69bdba072e722b557099f0 100644 (file)
@@ -56,12 +56,12 @@ struct bfin_serial_port {
        unsigned int            rx_dma_channel;
        struct work_struct      tx_dma_workqueue;
 #else
-       struct work_struct      cts_workqueue;
 # if ANOMALY_05000230
        unsigned int anomaly_threshold;
 # endif
 #endif
 #ifdef CONFIG_SERIAL_BFIN_CTSRTS
+       struct work_struct      cts_workqueue;
        int                     cts_pin;
        int                     rts_pin;
 #endif
index f18c517cc935909c34837a93fe5c41047e6b3dc3..8fc672d3105747a75efa3cb86676f6877c176a0c 100644 (file)
@@ -67,10 +67,9 @@ struct bfin_serial_port {
        unsigned int            tx_dma_channel;
        unsigned int            rx_dma_channel;
        struct work_struct      tx_dma_workqueue;
-#else
-       struct work_struct      cts_workqueue;
 #endif
 #ifdef CONFIG_SERIAL_BFIN_CTSRTS
+       struct work_struct      cts_workqueue;
        int             cts_pin;
        int             rts_pin;
 #endif
index 8733d47747e561af71d8baecc54325fc9d7befd1..c459c48464699690f5a996a2a207554c6eac43ee 100644 (file)
@@ -69,10 +69,9 @@ struct bfin_serial_port {
        unsigned int            tx_dma_channel;
        unsigned int            rx_dma_channel;
        struct work_struct      tx_dma_workqueue;
-#else
-       struct work_struct      cts_workqueue;
 #endif
 #ifdef CONFIG_SERIAL_BFIN_CTSRTS
+       struct work_struct      cts_workqueue;
        int             cts_pin;
        int             rts_pin;
 #endif
index a1b4f4eebd069e28b426b1ae31da8adf11ffbcf3..b6f513bee56ece582d69bdba072e722b557099f0 100644 (file)
@@ -56,12 +56,12 @@ struct bfin_serial_port {
        unsigned int            rx_dma_channel;
        struct work_struct      tx_dma_workqueue;
 #else
-       struct work_struct      cts_workqueue;
 # if ANOMALY_05000230
        unsigned int anomaly_threshold;
 # endif
 #endif
 #ifdef CONFIG_SERIAL_BFIN_CTSRTS
+       struct work_struct      cts_workqueue;
        int                     cts_pin;
        int                     rts_pin;
 #endif