#define MF624_GPIOC_DACEN (1 << 26) /* Enable D/A outputs */
-typedef struct mf624_board_struct{
+typedef struct mf624_board_struct {
char *name;
unsigned short device_id;
unsigned int ai_chans;
ao_bits: 14, /* Num of DAC bits */
di_chans: 8, /* Num of digital in */
do_chans: 8, /* Num of digital out */
- },
+ }
};
/* Number of boards */
/* Private data structure */
-typedef struct{
+typedef struct {
int data;
/* would be useful for a PCI device */
unsigned long BAR2;
unsigned long BAR4;
- void* IO_BAR0;
- void* IO_BAR2;
- void* IO_BAR4;
+ void __iomem *IO_BAR0;
+ void __iomem *IO_BAR2;
+ void __iomem *IO_BAR4;
/* Used for AO readback */
lsampl_t ao_readback[8];
/* Attach/detach functions declaration */
-/*static int mf624_attach(struct comedi_device *dev, struct comedi_devconfig *it);
+static int mf624_attach(struct comedi_device *dev, struct comedi_devconfig *it);
static int mf624_detach(struct comedi_device *dev);
-*/
+
/* Analog functions operation to be attached */
static int mf624_ai_rinsn(struct comedi_device *dev, struct comedi_subdevice *s,
struct pci_dev* pcidev;
unsigned int index, channel, status;
- printk("comedi%d: mf624: driver: Bourgeot - Poulain 2006-2007\n", dev->minor);
- printk("This is an experimental version, you can report \
- some remarks or problems to fpoulain@gmail.com\n");
-
+ printk("comedi%d: mf624: ", dev->minor);
/* Allocate the private structure area. alloc_private() is a
convenient macro defined in comedidev.h. */
/* Probe the device to determine what device in the series it is */
for(pcidev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, NULL);
pcidev != NULL;
- pcidev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pcidev)) {
+ pcidev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, pcidev))
+ {
if(pcidev->vendor != PCI_VENDOR_ID_MF624) {
continue;
}
/* loop through cards supported by this driver */
- for(index = 0; index < N_BOARDS ; index++)
+ for(index = 0; index < N_BOARDS; index++)
{
if(mf624_boards[index].device_id != pcidev->device) {
continue;
goto found;
}
}
-#ifdef EXTDEBUG
- printk("comedi%d: mf624: No supported Humusoft card \
- found on requested position\n", dev->minor);
-#endif
+
comedi_error(dev, "No supported Humusoft card found on requested position\n");
return -EIO;
printk("comedi%d: mf624: Found %s on bus %i, slot %i\n", dev->minor,
mf624_boards[index].name, pcidev->bus->number, PCI_SLOT(pcidev->devfn));
- /* Enable PCI device and reserve I/O ports. */
+ /* Enable PCI device and reserve memory. */
if(pci_enable_device(pcidev)) {
-#ifdef EXTDEBUG
- printk("comedi%d: mf624: Failed to enable PCI device\n", dev->minor);
-#endif
comedi_error(dev, "Failed to enable PCI device\n");
return -EIO;
}
+
if(pci_request_regions(pcidev, "mf624")) {
-#ifdef EXTDEBUG
- printk("comedi%d: mf624: I/O port conflict\n", dev->minor);
-#endif
- comedi_error(dev, "I/O port conflict\n");
+ comedi_error(dev, "Card's IO ports allready in use\n");
return -EIO;
}
}
//printk("comedi%d: mf624: Board initialized\n", dev->minor);
- return 1;
+ return 0;
}