From 1d78fdb913c26b2d5ce4e20fc085e348981d9626 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Mon, 23 Apr 2001 20:23:53 +0000 Subject: [PATCH] Added PCI-6713 and PCI-6711 board definitions. Added disable of AI subdevice if no AI capability. --- comedi/drivers/ni_mio_common.c | 30 +++++++++++++++++------------- comedi/drivers/ni_pcimio.c | 31 +++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 13 deletions(-) diff --git a/comedi/drivers/ni_mio_common.c b/comedi/drivers/ni_mio_common.c index 0d030166..53824a0f 100644 --- a/comedi/drivers/ni_mio_common.c +++ b/comedi/drivers/ni_mio_common.c @@ -1819,18 +1819,22 @@ static int ni_E_init(comedi_device *dev,comedi_devconfig *it) /* analog input subdevice */ s=dev->subdevices+0; - dev->read_subdev=s; - s->type=COMEDI_SUBD_AI; - s->subdev_flags=SDF_READABLE|SDF_RT|SDF_GROUND|SDF_COMMON|SDF_DIFF|SDF_OTHER; - s->subdev_flags|=SDF_DITHER; - s->n_chan=boardtype.n_adchan; - s->len_chanlist=512; /* XXX is this the same for PCI-MIO ? */ - s->maxdata=(1<range_table=ni_range_lkup[boardtype.gainlkup]; - s->insn_read=ni_ai_insn_read; - s->do_cmdtest=ni_ai_cmdtest; - s->do_cmd=ni_ai_cmd; - s->cancel=ni_ai_reset; + if(boardtype.n_adchan){ + dev->read_subdev=s; + s->type=COMEDI_SUBD_AI; + s->subdev_flags=SDF_READABLE|SDF_RT|SDF_GROUND|SDF_COMMON|SDF_DIFF|SDF_OTHER; + s->subdev_flags|=SDF_DITHER; + s->n_chan=boardtype.n_adchan; + s->len_chanlist=512; /* XXX is this the same for PCI-MIO ? */ + s->maxdata=(1<range_table=ni_range_lkup[boardtype.gainlkup]; + s->insn_read=ni_ai_insn_read; + s->do_cmdtest=ni_ai_cmdtest; + s->do_cmd=ni_ai_cmd; + s->cancel=ni_ai_reset; + }else{ + s->type=COMEDI_SUBD_UNUSED; + } /* analog output subdevice */ @@ -1850,7 +1854,7 @@ static int ni_E_init(comedi_device *dev,comedi_devconfig *it) s->insn_write=ni_ao_insn_write; s->do_cmd=ni_ao_cmd; s->do_cmdtest=ni_ao_cmdtest; - s->len_chanlist = 2; + s->len_chanlist = boardtype.n_aochan; }else{ s->type=COMEDI_SUBD_UNUSED; } diff --git a/comedi/drivers/ni_pcimio.c b/comedi/drivers/ni_pcimio.c index b8247122..1f985567 100644 --- a/comedi/drivers/ni_pcimio.c +++ b/comedi/drivers/ni_pcimio.c @@ -301,6 +301,7 @@ static ni_board ni_boards[]={ alwaysdither: 1, gainlkup: ai_gain_16, ai_speed: 3000, + n_aochan: 2, aobits: 16, ao_unipolar: 1, ao_fifo_depth: 2048, @@ -327,11 +328,41 @@ static ni_board ni_boards[]={ alwaysdither: 0, gainlkup: ai_gain_14, ai_speed: 200, + n_aochan: 2, aobits: 12, ao_unipolar: 0, ao_fifo_depth: 2048, caldac: type4, /* XXX */ }, +#if 0 + { device_id: 0x0000, /* unknown */ + name: "pci-6711", + n_adchan: 0, + adbits: 0, + ai_fifo_depth: 0, + alwaysdither: 0, + gainlkup: 0, + ai_speed: 0, + ao_chan: 4, + aobits: 12, + ao_unipolar: 0, + ao_fifo_depth: 8192, + caldac: type4, /* XXX */ + }, +#endif + { device_id: 0x1870, + name: "pci-6713", + n_adchan: 0, + adbits: 0, + ai_fifo_depth: 0, + alwaysdither: 0, + gainlkup: 0, + ai_speed: 0, + ao_chan: 8, + aobits: 12, + ao_unipolar: 0, + ao_fifo_depth: 16384, + caldac: type4, /* XXX */ #if 0 { device_id: 0x0000, /* unknown */ name: "pci-6040e", -- 2.26.2