rt2800: initialize BBP_R104 on proper subroutines
[linux/fpc-iii.git] / drivers / tty / hvc / hvc_irq.c
blobc9adb0559f61c2b743125b35713df17e3720e624
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();
17 return IRQ_HANDLED;
21 * For IRQ based systems these callbacks can be used
23 int notifier_add_irq(struct hvc_struct *hp, int irq)
25 int rc;
27 if (!irq) {
28 hp->irq_requested = 0;
29 return 0;
31 rc = request_irq(irq, hvc_handle_interrupt, 0,
32 "hvc_console", hp);
33 if (!rc)
34 hp->irq_requested = 1;
35 return rc;
38 void notifier_del_irq(struct hvc_struct *hp, int irq)
40 if (!hp->irq_requested)
41 return;
42 free_irq(irq, hp);
43 hp->irq_requested = 0;
46 void notifier_hangup_irq(struct hvc_struct *hp, int irq)
48 notifier_del_irq(hp, irq);