Patch from tomasz for INSN_INITTRIG
authorDavid Schleef <ds@schleef.org>
Fri, 20 Dec 2002 23:29:41 +0000 (23:29 +0000)
committerDavid Schleef <ds@schleef.org>
Fri, 20 Dec 2002 23:29:41 +0000 (23:29 +0000)
comedi/kcomedilib/kcomedilib_main.c

index f07e1ba3dc43409b67f58910bf596cf7f7ada553..586199ba2b529125fd7e6f3513492bb0da8b07d6 100644 (file)
@@ -214,6 +214,30 @@ int comedi_do_insn(comedi_t *d,comedi_insn *insn)
                        udelay(insn->data[0]);
                        ret=1;
                        break;
+               case INSN_INTTRIG:
+                       if(insn->n!=1){
+                               ret=-EINVAL;
+                               break;
+                       }
+                       if(insn->subdev>=dev->n_subdevices){
+                               rt_printk("%d not usable subdevice\n",insn->subdev);
+                               ret=-EINVAL;
+                               break;
+                       }
+                       s=dev->subdevices+insn->subdev;
+                       if(!s->async){
+                               rt_printk("no async\n");
+                               ret=-EINVAL;
+                               break;
+                       }
+                       if(!s->async->inttrig){
+                               rt_printk("no inttrig\n");
+                               ret=-EAGAIN;
+                               break;
+                       }
+                       ret = s->async->inttrig(dev,s,insn->data[0]);
+                       if(ret>=0)ret = 1;
+                       break;
                default:
                        ret = -EINVAL;
                }