{
struct timeval tv;
+ if(insn.n!=2){
+ ret=-EINVAL;
+ goto error;
+ }
+
do_gettimeofday(&tv);
data[0]=tv.tv_sec;
data[1]=tv.tv_usec;
break;
}
case INSN_WAIT:
- if(insn.n<1 || data[0]>=100000){
+ if(insn.n!=1 || data[0]>=100000){
ret=-EINVAL;
break;
}
udelay(data[0]/1000);
ret=1;
break;
+ case INSN_INTTRIG:
+ if(insn.subdev>=dev->n_subdevices){
+ DPRINTK("%d not useable subdevice\n",insn.subdev);
+ ret=-EINVAL;
+ goto error;
+ }
+ s=dev->subdevices+insn.subdev;
+ if(!s->async || !s->async->inttrig){
+ DPRINTK("no async or no inttrig\n");
+ ret=-EINVAL;
+ goto error;
+ }
+ ret = s->async->inttrig(dev,s,0);
+ break;
default:
+ DPRINTK("invalid insn\n");
ret=-EINVAL;
}
}else{
#define INSN_CONFIG ( 3 | INSN_MASK_READ|INSN_MASK_WRITE)
#define INSN_GTOD ( 4 | INSN_MASK_READ|INSN_MASK_SPECIAL)
#define INSN_WAIT ( 5 | INSN_MASK_WRITE|INSN_MASK_SPECIAL)
+#define INSN_INTTRIG ( 6 | INSN_MASK_WRITE|INSN_MASK_SPECIAL)
/* trigger flags */
#define TRIG_EXT 0x00000040 /* trigger on external signal N */
#define TRIG_INT 0x00000080 /* trigger on comedi-internal signal N */
-#define TRIG_INVAL 0x00000100 /* choice was invalid */
-
/* subdevice flags */
#define SDF_BUSY 0x0001 /* device is busy */
int (*do_lock)(comedi_device *,comedi_subdevice *);
int (*do_unlock)(comedi_device *,comedi_subdevice *);
+ int (*buf_change)(comedi_device *,comedi_subdevice *s);
+
unsigned int state;
};
unsigned int cb_mask;
int (*cb_func)(unsigned int flags,void *);
void *cb_arg;
+
+ int (*inttrig)(comedi_device *dev,comedi_subdevice *s,unsigned int x);
};
struct comedi_driver_struct{