diff options
author | Dave Jones <davej@redhat.com> | 2005-11-21 09:56:52 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2005-11-21 09:56:52 -0500 |
commit | e7e37ee9c547213d726b29c2510cbb6696050405 (patch) | |
tree | 50c45625de666b23f209d79eb1bfae05c64feee9 /drivers/serial/mux.c | |
parent | c243f1f1f6545985afcc6adf1fc085729029c3ee (diff) | |
parent | db93a82fa9d8b4d6e31c227922eaae829253bb88 (diff) |
Merge ../linus/
Diffstat (limited to 'drivers/serial/mux.c')
-rw-r--r-- | drivers/serial/mux.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/serial/mux.c b/drivers/serial/mux.c index 660bae5ba179..7633132a10aa 100644 --- a/drivers/serial/mux.c +++ b/drivers/serial/mux.c | |||
@@ -65,8 +65,8 @@ static struct uart_driver mux_driver = { | |||
65 | 65 | ||
66 | static struct timer_list mux_timer; | 66 | static struct timer_list mux_timer; |
67 | 67 | ||
68 | #define UART_PUT_CHAR(p, c) __raw_writel((c), (unsigned long)(p)->membase + IO_DATA_REG_OFFSET) | 68 | #define UART_PUT_CHAR(p, c) __raw_writel((c), (p)->membase + IO_DATA_REG_OFFSET) |
69 | #define UART_GET_FIFO_CNT(p) __raw_readl((unsigned long)(p)->membase + IO_DCOUNT_REG_OFFSET) | 69 | #define UART_GET_FIFO_CNT(p) __raw_readl((p)->membase + IO_DCOUNT_REG_OFFSET) |
70 | #define GET_MUX_PORTS(iodc_data) ((((iodc_data)[4] & 0xf0) >> 4) * 8) + 8 | 70 | #define GET_MUX_PORTS(iodc_data) ((((iodc_data)[4] & 0xf0) >> 4) * 8) + 8 |
71 | 71 | ||
72 | /** | 72 | /** |
@@ -79,10 +79,7 @@ static struct timer_list mux_timer; | |||
79 | */ | 79 | */ |
80 | static unsigned int mux_tx_empty(struct uart_port *port) | 80 | static unsigned int mux_tx_empty(struct uart_port *port) |
81 | { | 81 | { |
82 | unsigned int cnt = __raw_readl((unsigned long)port->membase | 82 | return UART_GET_FIFO_CNT(port) ? 0 : TIOCSER_TEMT; |
83 | + IO_DCOUNT_REG_OFFSET); | ||
84 | |||
85 | return cnt ? 0 : TIOCSER_TEMT; | ||
86 | } | 83 | } |
87 | 84 | ||
88 | /** | 85 | /** |
@@ -218,8 +215,7 @@ static void mux_read(struct uart_port *port) | |||
218 | __u32 start_count = port->icount.rx; | 215 | __u32 start_count = port->icount.rx; |
219 | 216 | ||
220 | while(1) { | 217 | while(1) { |
221 | data = __raw_readl((unsigned long)port->membase | 218 | data = __raw_readl(port->membase + IO_DATA_REG_OFFSET); |
222 | + IO_DATA_REG_OFFSET); | ||
223 | 219 | ||
224 | if (MUX_STATUS(data)) | 220 | if (MUX_STATUS(data)) |
225 | continue; | 221 | continue; |
@@ -481,6 +477,13 @@ static int __init mux_probe(struct parisc_device *dev) | |||
481 | port->ops = &mux_pops; | 477 | port->ops = &mux_pops; |
482 | port->flags = UPF_BOOT_AUTOCONF; | 478 | port->flags = UPF_BOOT_AUTOCONF; |
483 | port->line = port_cnt; | 479 | port->line = port_cnt; |
480 | |||
481 | /* The port->timeout needs to match what is present in | ||
482 | * uart_wait_until_sent in serial_core.c. Otherwise | ||
483 | * the time spent in msleep_interruptable will be very | ||
484 | * long, causing the appearance of a console hang. | ||
485 | */ | ||
486 | port->timeout = HZ / 50; | ||
484 | spin_lock_init(&port->lock); | 487 | spin_lock_init(&port->lock); |
485 | status = uart_add_one_port(&mux_driver, port); | 488 | status = uart_add_one_port(&mux_driver, port); |
486 | BUG_ON(status); | 489 | BUG_ON(status); |