int data;
unsigned long digitalio;
- unsigned long dac;
/* unsigned long control_status; */
/* unsigned long adc_fifo; */
/* lowlevel read from eeprom */
static unsigned int cb_pcidda_serial_in(struct comedi_device *dev)
{
- struct cb_pcidda_private *devpriv = dev->private;
unsigned int value = 0;
int i;
const int value_width = 16; /* number of bits wide values are */
for (i = 1; i <= value_width; i++) {
/* read bits most significant bit first */
- if (inw_p(devpriv->dac + DACALIBRATION1) & SERIAL_OUT_BIT)
+ if (inw_p(dev->iobase + DACALIBRATION1) & SERIAL_OUT_BIT)
value |= 1 << (value_width - i);
}
devpriv->dac_cal1_bits |= SERIAL_IN_BIT;
else
devpriv->dac_cal1_bits &= ~SERIAL_IN_BIT;
- outw_p(devpriv->dac_cal1_bits, devpriv->dac + DACALIBRATION1);
+ outw_p(devpriv->dac_cal1_bits, dev->iobase + DACALIBRATION1);
}
}
static unsigned int cb_pcidda_read_eeprom(struct comedi_device *dev,
unsigned int address)
{
- struct cb_pcidda_private *devpriv = dev->private;
unsigned int i;
unsigned int cal2_bits;
unsigned int value;
/* deactivate caldacs (one caldac for every two channels) */
for (i = 0; i < max_num_caldacs; i++)
cal2_bits |= DESELECT_CALDAC_BIT(i);
- outw_p(cal2_bits, devpriv->dac + DACALIBRATION2);
+ outw_p(cal2_bits, dev->iobase + DACALIBRATION2);
/* tell eeprom we want to read */
cb_pcidda_serial_out(dev, read_instruction, instruction_length);
/* deactivate eeprom */
cal2_bits &= ~SELECT_EEPROM_BIT;
- outw_p(cal2_bits, devpriv->dac + DACALIBRATION2);
+ outw_p(cal2_bits, dev->iobase + DACALIBRATION2);
return value;
}
unsigned int caldac, unsigned int channel,
unsigned int value)
{
- struct cb_pcidda_private *devpriv = dev->private;
unsigned int cal2_bits;
unsigned int i;
/* caldacs use 3 bit channel specification */
cal2_bits |= DESELECT_CALDAC_BIT(i);
/* activate the caldac we want */
cal2_bits &= ~DESELECT_CALDAC_BIT(caldac);
- outw_p(cal2_bits, devpriv->dac + DACALIBRATION2);
+ outw_p(cal2_bits, dev->iobase + DACALIBRATION2);
/* deactivate caldac */
cal2_bits |= DESELECT_CALDAC_BIT(caldac);
- outw_p(cal2_bits, devpriv->dac + DACALIBRATION2);
+ outw_p(cal2_bits, dev->iobase + DACALIBRATION2);
}
/* returns caldac that calibrates given analog out channel */
/* output channel specification */
command |= channel << 2;
- outw(command, devpriv->dac + DACONTROL);
+ outw(command, dev->iobase + DACONTROL);
/* write data */
- outw(data[0], devpriv->dac + DADATA + channel * 2);
+ outw(data[0], dev->iobase + DADATA + channel * 2);
/* return the number of samples read/written */
return 1;
ret = comedi_pci_enable(pcidev, dev->board_name);
if (ret)
return ret;
+ dev->iobase = pci_resource_start(pcidev, 3);
devpriv->digitalio = pci_resource_start(pcidev, 2);
- devpriv->dac = pci_resource_start(pcidev, 3);
- dev->iobase = devpriv->dac;
if (thisboard->status == 2)
printk