dev->minor,
lcr_io_base,
lcr_io_range);
-
- if (check_region (lcr_io_base, lcr_io_range) < 0)
- {
- printk("comedi%d: I/O port conflict\n",dev->minor);
- return -EIO;
- }
-
+
// Read PCI6308 register base address [PCI_BASE_ADDRESS #2].
-
+
io_base = pci_resource_start (pci_device, 2);
io_range = pci_resource_end (pci_device, 2) - io_base +1;
-
+
printk ("comedi%d: 6503 registers at address 0x%4x [0x%4x]\n",
dev->minor,
io_base,
io_range);
- if (check_region (io_base, io_range) < 0)
- {
- printk("comedi%d: I/O port conflict\n",dev->minor);
- return -EIO;
- }
-
// Allocate IO ressources
-
- pci_request_regions(pci_device, PCI9111_DRIVER_NAME);
-
+ if(pci_request_regions(pci_device, PCI9111_DRIVER_NAME))
+ {
+ printk("comedi%d: I/O port conflict\n",dev->minor);
+ return -EIO;
+ }
+
dev->iobase=io_base;
dev->board_name = board->name;
comedi_subdevice *s;
struct pci_dev* pcidev;
int index;
- unsigned int dac, digitalio;
printk("comedi%d: cb_pcidda: ",dev->minor);
}
}
printk("Not a supported ComputerBoards/MeasurementComputing card on "
- "requested position\n");
+ "requested position\n");
return -EIO;
found:
*/
if(pci_enable_device(devpriv->pci_dev))
return -EIO;
- digitalio = pci_resource_start(devpriv->pci_dev, DIGITALIO_BADRINDEX);
- dac = pci_resource_start(devpriv->pci_dev, DAC_BADRINDEX);
/*
* Allocate the I/O ports.
*/
- if (check_region(digitalio, DIGITALIO_SIZE) < 0)
+ if (pci_request_regions(devpriv->pci_dev, thisboard->name))
{
- printk("I/O port conflict: failed to allocate ports 0x%x to 0x%x\n",
- digitalio, digitalio + DIGITALIO_SIZE - 1);
+ printk("cb_pcidda: I/O port conflict\n");
return -EIO;
}
- if (check_region(dac, 8 + thisboard->ao_chans*2) < 0)
- {
- printk("I/O port conflict: failed to allocate ports 0x%x to 0x%x\n",
- dac, dac + 7 + thisboard->ao_chans*2);
- return -EIO;
- }
- request_region(digitalio, DIGITALIO_SIZE, thisboard->name);
- devpriv->digitalio = digitalio;
- request_region(dac, 8 + thisboard->ao_chans*2,
- thisboard->name);
- devpriv->dac = dac;
+ devpriv->digitalio = pci_resource_start(devpriv->pci_dev, DIGITALIO_BADRINDEX);
+ devpriv->dac = pci_resource_start(devpriv->pci_dev, DAC_BADRINDEX);
/*
* Warn about the status of the driver.
const int address_length = 8;
// send serial output stream to eeprom
- cal2_bits = SELECT_EEPROM_BIT | DESELECT_REF_DAC_BIT;
+ cal2_bits = SELECT_EEPROM_BIT | DESELECT_REF_DAC_BIT | DUMMY_BIT;
// deactivate caldacs (one caldac for every two channels)
for(i = 0; i < max_num_caldacs; i++)
{
// latch stream into appropriate caldac
// deselect reference dac
- cal2_bits = DESELECT_REF_DAC_BIT;
+ cal2_bits = DESELECT_REF_DAC_BIT | DUMMY_BIT;
// deactivate caldacs (one caldac for every two channels)
for(i = 0; i < max_num_caldacs; i++)
{