提交 4cb4f22b 编写于 作者: S Sonic Zhang 提交者: Bryan Wu

[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=3858Signed-off-by: NSonic Zhang <sonic.zhang@analog.com>
Signed-off-by: NBryan Wu <bryan.wu@analog.com>
上级 09545568
...@@ -53,7 +53,6 @@ ...@@ -53,7 +53,6 @@
#ifdef CONFIG_SERIAL_BFIN_DMA #ifdef CONFIG_SERIAL_BFIN_DMA
static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart); static void bfin_serial_dma_tx_chars(struct bfin_serial_port *uart);
#else #else
static void bfin_serial_do_work(struct work_struct *work);
static void bfin_serial_tx_chars(struct bfin_serial_port *uart); static void bfin_serial_tx_chars(struct bfin_serial_port *uart);
#endif #endif
...@@ -372,8 +371,9 @@ static irqreturn_t bfin_serial_tx_int(int irq, void *dev_id) ...@@ -372,8 +371,9 @@ static irqreturn_t bfin_serial_tx_int(int irq, void *dev_id)
return IRQ_HANDLED; return IRQ_HANDLED;
} }
#endif
#ifdef CONFIG_SERIAL_BFIN_CTSRTS
static void bfin_serial_do_work(struct work_struct *work) static void bfin_serial_do_work(struct work_struct *work)
{ {
struct bfin_serial_port *uart = container_of(work, struct bfin_serial_port, cts_workqueue); 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,22 +607,17 @@ static void bfin_serial_mctrl_check(struct bfin_serial_port *uart)
{ {
#ifdef CONFIG_SERIAL_BFIN_CTSRTS #ifdef CONFIG_SERIAL_BFIN_CTSRTS
unsigned int status; unsigned int status;
# ifdef CONFIG_SERIAL_BFIN_DMA
struct uart_info *info = uart->port.info; struct uart_info *info = uart->port.info;
struct tty_struct *tty = info->tty; struct tty_struct *tty = info->tty;
status = bfin_serial_get_mctrl(&uart->port); status = bfin_serial_get_mctrl(&uart->port);
uart_handle_cts_change(&uart->port, status & TIOCM_CTS);
if (!(status & TIOCM_CTS)) { if (!(status & TIOCM_CTS)) {
tty->hw_stopped = 1; tty->hw_stopped = 1;
schedule_work(&uart->cts_workqueue);
} else { } else {
tty->hw_stopped = 0; 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 #endif
} }
...@@ -939,10 +934,9 @@ static void __init bfin_serial_init_ports(void) ...@@ -939,10 +934,9 @@ static void __init bfin_serial_init_ports(void)
bfin_serial_ports[i].rx_dma_channel = bfin_serial_ports[i].rx_dma_channel =
bfin_serial_resource[i].uart_rx_dma_channel; bfin_serial_resource[i].uart_rx_dma_channel;
init_timer(&(bfin_serial_ports[i].rx_dma_timer)); init_timer(&(bfin_serial_ports[i].rx_dma_timer));
#else
INIT_WORK(&bfin_serial_ports[i].cts_workqueue, bfin_serial_do_work);
#endif #endif
#ifdef CONFIG_SERIAL_BFIN_CTSRTS #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_ports[i].cts_pin =
bfin_serial_resource[i].uart_cts_pin; bfin_serial_resource[i].uart_cts_pin;
bfin_serial_ports[i].rts_pin = bfin_serial_ports[i].rts_pin =
......
...@@ -67,10 +67,9 @@ struct bfin_serial_port { ...@@ -67,10 +67,9 @@ struct bfin_serial_port {
unsigned int tx_dma_channel; unsigned int tx_dma_channel;
unsigned int rx_dma_channel; unsigned int rx_dma_channel;
struct work_struct tx_dma_workqueue; struct work_struct tx_dma_workqueue;
#else
struct work_struct cts_workqueue;
#endif #endif
#ifdef CONFIG_SERIAL_BFIN_CTSRTS #ifdef CONFIG_SERIAL_BFIN_CTSRTS
struct work_struct cts_workqueue;
int cts_pin; int cts_pin;
int rts_pin; int rts_pin;
#endif #endif
......
...@@ -56,12 +56,12 @@ struct bfin_serial_port { ...@@ -56,12 +56,12 @@ struct bfin_serial_port {
unsigned int rx_dma_channel; unsigned int rx_dma_channel;
struct work_struct tx_dma_workqueue; struct work_struct tx_dma_workqueue;
#else #else
struct work_struct cts_workqueue;
# if ANOMALY_05000230 # if ANOMALY_05000230
unsigned int anomaly_threshold; unsigned int anomaly_threshold;
# endif # endif
#endif #endif
#ifdef CONFIG_SERIAL_BFIN_CTSRTS #ifdef CONFIG_SERIAL_BFIN_CTSRTS
struct work_struct cts_workqueue;
int cts_pin; int cts_pin;
int rts_pin; int rts_pin;
#endif #endif
......
...@@ -67,10 +67,9 @@ struct bfin_serial_port { ...@@ -67,10 +67,9 @@ struct bfin_serial_port {
unsigned int tx_dma_channel; unsigned int tx_dma_channel;
unsigned int rx_dma_channel; unsigned int rx_dma_channel;
struct work_struct tx_dma_workqueue; struct work_struct tx_dma_workqueue;
#else
struct work_struct cts_workqueue;
#endif #endif
#ifdef CONFIG_SERIAL_BFIN_CTSRTS #ifdef CONFIG_SERIAL_BFIN_CTSRTS
struct work_struct cts_workqueue;
int cts_pin; int cts_pin;
int rts_pin; int rts_pin;
#endif #endif
......
...@@ -69,10 +69,9 @@ struct bfin_serial_port { ...@@ -69,10 +69,9 @@ struct bfin_serial_port {
unsigned int tx_dma_channel; unsigned int tx_dma_channel;
unsigned int rx_dma_channel; unsigned int rx_dma_channel;
struct work_struct tx_dma_workqueue; struct work_struct tx_dma_workqueue;
#else
struct work_struct cts_workqueue;
#endif #endif
#ifdef CONFIG_SERIAL_BFIN_CTSRTS #ifdef CONFIG_SERIAL_BFIN_CTSRTS
struct work_struct cts_workqueue;
int cts_pin; int cts_pin;
int rts_pin; int rts_pin;
#endif #endif
......
...@@ -56,12 +56,12 @@ struct bfin_serial_port { ...@@ -56,12 +56,12 @@ struct bfin_serial_port {
unsigned int rx_dma_channel; unsigned int rx_dma_channel;
struct work_struct tx_dma_workqueue; struct work_struct tx_dma_workqueue;
#else #else
struct work_struct cts_workqueue;
# if ANOMALY_05000230 # if ANOMALY_05000230
unsigned int anomaly_threshold; unsigned int anomaly_threshold;
# endif # endif
#endif #endif
#ifdef CONFIG_SERIAL_BFIN_CTSRTS #ifdef CONFIG_SERIAL_BFIN_CTSRTS
struct work_struct cts_workqueue;
int cts_pin; int cts_pin;
int rts_pin; int rts_pin;
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册