aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/uartlite.c
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2009-09-09 10:54:04 -0400
committerLive-CD User <linux@linux.site>2009-09-19 16:13:38 -0400
commitd2cfe9628c6187cafd1aac32a44dcd9ed7adb5fe (patch)
tree8d341d3df935aa1710df451975f80eebdf3e61c2 /drivers/serial/uartlite.c
parent054f2346cb0e524cbb678759bfedabfdba4d0100 (diff)
uartlite: support shared interrupt lines
Adapt isr to work with shared interrupt lines. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial/uartlite.c')
-rw-r--r--drivers/serial/uartlite.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/drivers/serial/uartlite.c b/drivers/serial/uartlite.c
index 5d3a573d6994..377f2712289e 100644
--- a/drivers/serial/uartlite.c
+++ b/drivers/serial/uartlite.c
@@ -154,17 +154,22 @@ static int ulite_transmit(struct uart_port *port, int stat)
154static irqreturn_t ulite_isr(int irq, void *dev_id) 154static irqreturn_t ulite_isr(int irq, void *dev_id)
155{ 155{
156 struct uart_port *port = dev_id; 156 struct uart_port *port = dev_id;
157 int busy; 157 int busy, n = 0;
158 158
159 do { 159 do {
160 int stat = readb(port->membase + ULITE_STATUS); 160 int stat = readb(port->membase + ULITE_STATUS);
161 busy = ulite_receive(port, stat); 161 busy = ulite_receive(port, stat);
162 busy |= ulite_transmit(port, stat); 162 busy |= ulite_transmit(port, stat);
163 n++;
163 } while (busy); 164 } while (busy);
164 165
165 tty_flip_buffer_push(port->state->port.tty); 166 /* work done? */
166 167 if (n > 1) {
167 return IRQ_HANDLED; 168 tty_flip_buffer_push(port->state->port.tty);
169 return IRQ_HANDLED;
170 } else {
171 return IRQ_NONE;
172 }
168} 173}
169 174
170static unsigned int ulite_tx_empty(struct uart_port *port) 175static unsigned int ulite_tx_empty(struct uart_port *port)
@@ -221,7 +226,7 @@ static int ulite_startup(struct uart_port *port)
221 int ret; 226 int ret;
222 227
223 ret = request_irq(port->irq, ulite_isr, 228 ret = request_irq(port->irq, ulite_isr,
224 IRQF_DISABLED | IRQF_SAMPLE_RANDOM, "uartlite", port); 229 IRQF_SHARED | IRQF_SAMPLE_RANDOM, "uartlite", port);
225 if (ret) 230 if (ret)
226 return ret; 231 return ret;
227 232