static int ni_ao_insn_read(comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, lsampl_t * data)
{
+ if (insn->n == 0)
+ return 0;
+
data[0] = devpriv->ao[CR_CHAN(insn->chanspec)];
return 1;
unsigned int chan = CR_CHAN(insn->chanspec);
unsigned int invert;
+ if (insn->n == 0)
+ return 0;
+
invert = ni_ao_config_chanlist(dev, s, &insn->chanspec, 1, 0);
devpriv->ao[chan] = data[0];
unsigned int chan = CR_CHAN(insn->chanspec);
unsigned int invert;
+ if (insn->n == 0)
+ return 0;
+
ao_win_out(1 << chan, AO_Immediate_671x);
invert = 1 << (boardtype.aobits - 1);
static int ni_freq_out_insn_read(comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
{
+ if (insn->n == 0)
+ return 0;
+
data[0] = devpriv->clock_and_fout & FOUT_Divider_mask;
return 1;
}
static int ni_freq_out_insn_write(comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
{
+ if (insn->n == 0)
+ return 0;
+
devpriv->clock_and_fout &= ~FOUT_Enable;
devpriv->stc_writew(dev, devpriv->clock_and_fout,
Clock_and_FOUT_Register);
static int ni_eeprom_insn_read(comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, lsampl_t * data)
{
+ if (insn->n == 0)
+ return 0;
+
data[0] = ni_read_eeprom(dev, CR_CHAN(insn->chanspec));
return 1;
static int ni_m_series_eeprom_insn_read(comedi_device * dev,
comedi_subdevice * s, comedi_insn * insn, lsampl_t * data)
{
+ if (insn->n == 0)
+ return 0;
+
data[0] = devpriv->eeprom_buffer[CR_CHAN(insn->chanspec)];
return 1;
static int ni_calib_insn_write(comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, lsampl_t * data)
{
+ if (insn->n == 0)
+ return 0;
+
ni_write_caldac(dev, CR_CHAN(insn->chanspec), data[0]);
return 1;
static int ni_calib_insn_read(comedi_device * dev, comedi_subdevice * s,
comedi_insn * insn, lsampl_t * data)
{
+ if (insn->n == 0)
+ return 0;
+
data[0] = devpriv->caldacs[CR_CHAN(insn->chanspec)];
return 1;