From de9152246395253786f7eda572ea44fd8a40a054 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 6 Nov 2001 22:16:09 +0000 Subject: [PATCH] Added implementation of comedi_poll(). This function may be useful in the core, although presumably the behavior should be different if the driver doesn't implement poll. --- comedi/drivers/comedi_rt_timer.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/comedi/drivers/comedi_rt_timer.c b/comedi/drivers/comedi_rt_timer.c index 2d94bf12..bf2dcb57 100644 --- a/comedi/drivers/comedi_rt_timer.c +++ b/comedi/drivers/comedi_rt_timer.c @@ -567,6 +567,13 @@ static int timer_start_cmd(comedi_device *dev, comedi_subdevice *s) return 0; } +static int timer_poll(comedi_device *dev,comedi_subdevice *s) +{ + /* This it pretty generic code, perhaps it should be the + * default for any subdevice that doesn't implement poll. */ + return s->async->buf_int_count - s->async->buf_user_count; +} + static int timer_attach(comedi_device *dev,comedi_devconfig *it) { int ret; @@ -603,6 +610,7 @@ static int timer_attach(comedi_device *dev,comedi_devconfig *it) // input or output subdevice s=dev->subdevices+0; + s->poll=timer_poll; if(emul_s->type == COMEDI_SUBD_AI) { s->type=emul_s->type; -- 2.26.2