sh_eth: fix EESIPR values for SH77{34|63}
[linux/fpc-iii.git] / drivers / tty / hvc / hvc_irq.c
blobbc7a96874637baf9961ea6f998edd1be4b533ebb
1 /*
2 * Copyright IBM Corp. 2001,2008
4 * This file contains the IRQ specific code for hvc_console
6 */
8 #include <linux/interrupt.h>
10 #include "hvc_console.h"
12 static irqreturn_t hvc_handle_interrupt(int irq, void *dev_instance)
14 /* if hvc_poll request a repoll, then kick the hvcd thread */
15 if (hvc_poll(dev_instance))
16 hvc_kick();
19 * We're safe to always return IRQ_HANDLED as the hvcd thread will
20 * iterate through each hvc_struct.
22 return IRQ_HANDLED;
26 * For IRQ based systems these callbacks can be used
28 int notifier_add_irq(struct hvc_struct *hp, int irq)
30 int rc;
32 if (!irq) {
33 hp->irq_requested = 0;
34 return 0;
36 rc = request_irq(irq, hvc_handle_interrupt, hp->flags,
37 "hvc_console", hp);
38 if (!rc)
39 hp->irq_requested = 1;
40 return rc;
43 void notifier_del_irq(struct hvc_struct *hp, int irq)
45 if (!hp->irq_requested)
46 return;
47 free_irq(irq, hp);
48 hp->irq_requested = 0;
51 void notifier_hangup_irq(struct hvc_struct *hp, int irq)
53 notifier_del_irq(hp, irq);