1 From b4d63327dfef8dbf12aabf4bba0f6818a3519995 Mon Sep 17 00:00:00 2001
2 From: Tim Waugh <twaugh@redhat.com>
3 Date: Tue, 8 Mar 2011 15:07:04 +0000
4 Subject: [PATCH] 2011-03-08 Tim Waugh <twaugh@redhat.com>
6 * src/ieee1284module.c: Added bindings for get_irq_fd and
7 clear_irq. Patch by Sergey Temerkhanov.
10 src/ieee1284module.c | 33 +++++++++++++++++++++++++++++++++
11 2 files changed, 38 insertions(+)
13 diff --git a/src/ieee1284module.c b/src/ieee1284module.c
14 index 0093d6f..23c1f29 100644
15 --- a/src/ieee1284module.c
16 +++ b/src/ieee1284module.c
17 @@ -189,6 +189,33 @@ Parport_open (ParportObject *self, PyObject *args)
18 return PyInt_FromLong (capabilities);
22 +Parport_get_irq_fd (ParportObject *self)
24 + int fd = ieee1284_get_irq_fd (self->port);
30 + return PyInt_FromLong (fd);
34 +Parport_clear_irq (ParportObject *self)
39 + int fd = ieee1284_clear_irq (self->port, &portcount);
45 + return PyInt_FromLong (portcount);
49 Parport_close (ParportObject *self)
51 @@ -484,6 +511,12 @@ PyMethodDef Parport_methods[] = {
52 { "close", (PyCFunction) Parport_close, METH_NOARGS,
55 + { "get_irq_fd", (PyCFunction) Parport_get_irq_fd, METH_VARARGS,
56 + "get_irq_fd() -> int\n"
57 + "Returns a pollable IRQ file descriptor." },
58 + { "clear_irq", (PyCFunction) Parport_clear_irq, METH_NOARGS,
59 + "clear_irq(portcount) -> int\n"
60 + "Clears IRQ and returns number of IRQs raised." },
61 { "claim", (PyCFunction) Parport_claim, METH_NOARGS,