@CONFIG_COMEDI_RT_TRUE@CONFIG_COMEDI_RT=y
@CONFIG_COMEDI_RT_TRUE@CONFIG_COMEDI_RT_MODULES=m
+@CONFIG_COMEDI_PCI_TRUE@CONFIG_COMEDI_PCI_MODULES=m
@CONFIG_COMEDI_PCMCIA_TRUE@CONFIG_COMEDI_PCMCIA_MODULES=m
@CONFIG_COMEDI_USB_TRUE@CONFIG_COMEDI_USB_MODULES=m
obj-$(CONFIG_COMEDI_RT_MODULES) += comedi_rt_timer.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += mite.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += icp_multi.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += addi_apci_035.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += addi_apci_1032.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += addi_apci_1500.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += addi_apci_1516.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += addi_apci_1564.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += addi_apci_16xx.o
+#obj-$(CONFIG_COMEDI_PCI_MODULES) += addi_apci_1710.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += addi_apci_2016.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += addi_apci_2032.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += addi_apci_2200.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += addi_apci_3001.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += addi_apci_3120.o
+#obj-$(CONFIG_COMEDI_PCI_MODULES) += addi_apci_3200.o
+#obj-$(CONFIG_COMEDI_PCI_MODULES) += addi_apci_3300.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += addi_apci_3501.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += addi_apci_3xxx.o
+#obj-$(CONFIG_COMEDI_PCI_MODULES) += addi_apci_all.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += adl_pci6208.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += adl_pci7296.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += adl_pci7432.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += adl_pci8164.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += adl_pci9111.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += adl_pci9118.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += adv_pci1710.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += adv_pci1723.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += adv_pci_dio.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += amplc_pci224.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += amplc_pci230.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += cb_pcidas.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += cb_pcidas64.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += cb_pcidda.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += cb_pcidio.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += cb_pcimdas.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += cb_pcimdda.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += contec_pci_dio.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += daqboard2000.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += dt3000.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += gsc_hpdi.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += ii_pci20kc.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += jr3_pci.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += ke_counter.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += me_daq.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += me4000.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += ni_6527.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += ni_65xx.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += ni_660x.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += ni_670x.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += ni_pcidio.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += ni_pcimio.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += rtd520.o
+obj-$(CONFIG_COMEDI_PCI_MODULES) += s626.o
+
obj-$(CONFIG_COMEDI_PCMCIA_MODULES) += cb_das16_cs.o
obj-$(CONFIG_COMEDI_PCMCIA_MODULES) += das08_cs.o
obj-$(CONFIG_COMEDI_PCMCIA_MODULES) += ni_daq_700.o
obj-m += 8255.o
obj-m += comedi_fc.o
obj-m += das08.o
-obj-m += mite.o
obj-m += ni_labpc.o
obj-m += acl7225b.o
-obj-m += addi_apci_035.o
-obj-m += addi_apci_1032.o
-obj-m += addi_apci_1500.o
-obj-m += addi_apci_1516.o
-obj-m += addi_apci_1564.o
-obj-m += addi_apci_16xx.o
-#obj-m += addi_apci_1710.o
-obj-m += addi_apci_2016.o
-obj-m += addi_apci_2032.o
-obj-m += addi_apci_2200.o
-obj-m += addi_apci_3001.o
-obj-m += addi_apci_3120.o
-#obj-m += addi_apci_3200.o
-#obj-m += addi_apci_3300.o
-obj-m += addi_apci_3501.o
-obj-m += addi_apci_3xxx.o
-#obj-m += addi_apci_all.o
-obj-m += adl_pci6208.o
-obj-m += adl_pci7296.o
-obj-m += adl_pci7432.o
-obj-m += adl_pci8164.o
-obj-m += adl_pci9111.o
-obj-m += adl_pci9118.o
obj-m += adq12b.o
-obj-m += adv_pci1710.o
-obj-m += adv_pci1723.o
-obj-m += adv_pci_dio.o
obj-m += aio_aio12_8.o
obj-m += aio_iiro_16.o
-obj-m += amplc_pci224.o
-obj-m += amplc_pci230.o
obj-m += amplc_pc236.o
obj-m += amplc_pc263.o
obj-m += amplc_dio200.o
obj-m += c6xdigio.o
-obj-m += cb_pcidas.o
-obj-m += cb_pcidas64.o
-obj-m += cb_pcidda.o
-obj-m += cb_pcidio.o
-obj-m += cb_pcimdas.o
-obj-m += cb_pcimdda.o
obj-m += comedi_bond.o
-obj-m += contec_pci_dio.o
-obj-m += daqboard2000.o
obj-m += das16.o
obj-m += das16m1.o
obj-m += das6402.o
obj-m += dt2815.o
obj-m += dt2817.o
obj-m += dt282x.o
-obj-m += dt3000.o
obj-m += fl512.o
-obj-m += gsc_hpdi.o
-obj-m += ii_pci20kc.o
-obj-m += icp_multi.o
-obj-m += jr3_pci.o
-obj-m += ke_counter.o
-obj-m += me_daq.o
-obj-m += me4000.o
obj-m += mpc624.o
obj-m += multiq3.o
-obj-m += ni_6527.o
-obj-m += ni_65xx.o
-obj-m += ni_660x.o
-obj-m += ni_670x.o
obj-m += ni_at_a2150.o
obj-m += ni_at_ao.o
obj-m += ni_atmio.o
obj-m += ni_atmio16d.o
-obj-m += ni_pcimio.o
-obj-m += ni_pcidio.o
obj-m += ni_tio.o
obj-m += pcm3724.o
obj-m += pcm3730.o
obj-m += pcmuio.o
obj-m += pcmmio.o
obj-m += comedi_parport.o
-obj-m += rtd520.o
obj-m += rti800.o
obj-m += rti802.o
obj-m += serial2002.o
obj-m += skel.o
obj-m += ssv_dnp.o
obj-m += s526.o
-obj-m += s626.o
obj-m += comedi_test.o
obj-m += unioxx5.o
rt_modules =
endif
+if CONFIG_COMEDI_PCI
+pci_modules= \
+ mite.ko \
+ addi_apci_035.ko \
+ addi_apci_1032.ko \
+ addi_apci_1500.ko \
+ addi_apci_1516.ko \
+ addi_apci_1564.ko \
+ addi_apci_16xx.ko \
+ addi_apci_2016.ko \
+ addi_apci_2032.ko \
+ addi_apci_2200.ko \
+ addi_apci_3001.ko \
+ addi_apci_3120.ko \
+ addi_apci_3501.ko \
+ addi_apci_3xxx.ko \
+ adl_pci6208.ko \
+ adl_pci7296.ko \
+ adl_pci7432.ko \
+ adl_pci8164.ko \
+ adl_pci9111.ko \
+ adl_pci9118.ko \
+ adv_pci1710.ko \
+ adv_pci1723.ko \
+ adv_pci_dio.ko \
+ amplc_pci224.ko \
+ amplc_pci230.ko \
+ cb_pcidas.ko \
+ cb_pcidas64.ko \
+ cb_pcidda.ko \
+ cb_pcidio.ko \
+ cb_pcimdas.ko \
+ cb_pcimdda.ko \
+ contec_pci_dio.ko \
+ daqboard2000.ko \
+ dt3000.ko \
+ gsc_hpdi.ko \
+ icp_multi.ko \
+ ii_pci20kc.ko \
+ jr3_pci.ko \
+ ke_counter.ko \
+ me_daq.ko \
+ me4000.ko \
+ ni_6527.ko \
+ ni_65xx.ko \
+ ni_660x.ko \
+ ni_670x.ko \
+ ni_pcidio.ko \
+ ni_pcimio.ko \
+ rtd520.ko \
+ s626.ko
+else
+pci_modules=
+endif
+
+
if CONFIG_COMEDI_PCMCIA
pcmcia_modules= \
cb_das16_cs.ko \
8255.ko \
comedi_fc.ko \
das08.ko \
- mite.ko \
ni_labpc.ko \
acl7225b.ko \
- addi_apci_035.ko \
- addi_apci_1032.ko \
- addi_apci_1500.ko \
- addi_apci_1516.ko \
- addi_apci_1564.ko \
- addi_apci_16xx.ko \
- addi_apci_2016.ko \
- addi_apci_2032.ko \
- addi_apci_2200.ko \
- addi_apci_3001.ko \
- addi_apci_3120.ko \
- addi_apci_3501.ko \
- addi_apci_3xxx.ko \
- adl_pci6208.ko \
- adl_pci7296.ko \
- adl_pci7432.ko \
- adl_pci8164.ko \
- adl_pci9111.ko \
- adl_pci9118.ko \
adq12b.ko \
- adv_pci1710.ko \
- adv_pci1723.ko \
- adv_pci_dio.ko \
- amplc_pci224.ko \
- amplc_pci230.ko \
amplc_pc236.ko \
amplc_pc263.ko \
amplc_dio200.ko \
aio_aio12_8.ko \
aio_iiro_16.ko \
c6xdigio.ko \
- cb_pcidas.ko \
- cb_pcidas64.ko \
- cb_pcidda.ko \
- cb_pcidio.ko \
- cb_pcimdas.ko \
- cb_pcimdda.ko \
comedi_bond.ko \
- contec_pci_dio.ko \
- daqboard2000.ko \
das16.ko \
das16m1.ko \
das6402.ko \
dt2815.ko \
dt2817.ko \
dt282x.ko \
- dt3000.ko \
fl512.ko \
- gsc_hpdi.ko \
- ii_pci20kc.ko \
- icp_multi.ko \
- jr3_pci.ko \
- ke_counter.ko \
- me_daq.ko \
- me4000.ko \
mpc624.ko \
multiq3.ko \
- ni_660x.ko \
- ni_670x.ko \
ni_atmio.ko \
- ni_pcimio.ko \
- ni_pcidio.ko \
- ni_6527.ko \
- ni_65xx.ko \
ni_atmio16d.ko \
ni_at_a2150.ko \
ni_at_ao.ko \
pcmuio.ko \
pcmmio.ko \
comedi_parport.ko \
- rtd520.ko \
rti800.ko \
rti802.ko \
serial2002.ko \
skel.ko \
ssv_dnp.ko \
s526.ko \
- s626.ko \
comedi_test.ko \
unioxx5.ko \
+ $(pci_modules) \
$(pcmcia_modules) \
$(usb_modules) \
$(rt_modules)
model: pc215e_model,
layout: pc215_layout,
},
+#ifdef CONFIG_COMEDI_PCI
{
name: "pci215",
bustype: pci_bustype,
model: pci215_model,
layout: pc215_layout,
},
+#endif
{
name: "pc218e",
bustype: isa_bustype,
model: pc272e_model,
layout: pc272_layout,
},
+#ifdef CONFIG_COMEDI_PCI
{
name: "pci272",
bustype: pci_bustype,
model: pci272_model,
layout: pc272_layout,
},
+#endif
};
/*
* PCI driver table.
*/
+#ifdef CONFIG_COMEDI_PCI
static struct pci_device_id dio200_pci_table[] __devinitdata = {
{PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI215,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, pci215_model},
};
MODULE_DEVICE_TABLE(pci, dio200_pci_table);
+#endif /* CONFIG_COMEDI_PCI */
/*
* Useful for shorthand access to the particular board structure
several hardware drivers keep similar information in this structure,
feel free to suggest moving the variable to the comedi_device struct. */
typedef struct {
+#ifdef CONFIG_COMEDI_PCI
struct pci_dev *pci_dev; /* PCI device */
+#endif
int intr_sd;
} dio200_private;
* This function looks for a PCI device matching the requested board name,
* bus and slot.
*/
+#ifdef CONFIG_COMEDI_PCI
static int
dio200_find_pci(comedi_device * dev, int bus, int slot,
struct pci_dev **pci_dev_p)
}
return -EIO;
}
+#endif
/*
* This function checks and requests an I/O region, reporting an error
static int dio200_attach(comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
- struct pci_dev *pci_dev = NULL;
unsigned long iobase = 0;
unsigned int irq = 0;
+#ifdef CONFIG_COMEDI_PCI
+ struct pci_dev *pci_dev = NULL;
int bus = 0, slot = 0;
+#endif
const dio200_layout *layout;
int share_irq = 0;
int sdx;
irq = it->options[1];
share_irq = 0;
break;
+#ifdef CONFIG_COMEDI_PCI
case pci_bustype:
bus = it->options[0];
slot = it->options[1];
return ret;
devpriv->pci_dev = pci_dev;
break;
+#endif
default:
printk(KERN_ERR
"comedi%d: %s: BUG! cannot determine board type!\n",
devpriv->intr_sd = -1;
/* Enable device and reserve I/O spaces. */
+#ifdef CONFIG_COMEDI_PCI
if (pci_dev) {
ret = comedi_pci_enable(pci_dev, DIO200_DRIVER_NAME);
if (ret < 0) {
}
iobase = pci_resource_start(pci_dev, 2);
irq = pci_dev->irq;
- } else {
+ } else
+#endif
+ {
ret = dio200_request_region(dev->minor, iobase, DIO200_IO_SIZE);
if (ret < 0) {
return ret;
if (thisboard->bustype == isa_bustype) {
printk("(base %#lx) ", iobase);
} else {
+#ifdef CONFIG_COMEDI_PCI
printk("(pci %s) ", pci_name(pci_dev));
+#endif
}
if (irq) {
printk("(irq %u%s) ", irq, (dev->irq ? "" : " UNAVAILABLE"));
}
}
if (devpriv) {
+#ifdef CONFIG_COMEDI_PCI
if (devpriv->pci_dev) {
if (dev->iobase) {
comedi_pci_disable(devpriv->pci_dev);
}
pci_dev_put(devpriv->pci_dev);
- } else if (dev->iobase) {
- release_region(dev->iobase, DIO200_IO_SIZE);
+ } else
+#endif
+ {
+ if (dev->iobase) {
+ release_region(dev->iobase, DIO200_IO_SIZE);
+ }
}
}
if (dev->board_name) {
bustype: isa_bustype,
model: pc36at_model,
},
+#ifdef CONFIG_COMEDI_PCI
{
name: "pci236",
fancy_name:"PCI236",
bustype: pci_bustype,
model: pci236_model,
},
+#endif
};
+#ifdef CONFIG_COMEDI_PCI
static struct pci_device_id pc236_pci_table[] __devinitdata = {
{PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI236, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, pci236_model},
};
MODULE_DEVICE_TABLE(pci, pc236_pci_table);
+#endif /* CONFIG_COMEDI_PCI */
/*
* Useful for shorthand access to the particular board structure
several hardware drivers keep similar information in this structure,
feel free to suggest moving the variable to the comedi_device struct. */
typedef struct {
+#ifdef CONFIG_COMEDI_PCI
/* PCI device */
struct pci_dev *pci_dev;
unsigned long lcr_iobase; /* PLX PCI9052 config registers in PCIBAR1 */
+#endif
int enable_irq;
} pc236_private;
static int pc236_attach(comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
- struct pci_dev *pci_dev = NULL;
unsigned long iobase = 0;
unsigned int irq = 0;
+#ifdef CONFIG_COMEDI_PCI
+ struct pci_dev *pci_dev = NULL;
int bus = 0, slot = 0;
struct pci_device_id *pci_id;
+#endif
int share_irq = 0;
int ret;
irq = it->options[1];
share_irq = 0;
break;
+#ifdef CONFIG_COMEDI_PCI
case pci_bustype:
bus = it->options[0];
slot = it->options[1];
return -EIO;
}
break;
+#endif /* CONFIG_COMEDI_PCI */
default:
printk("bug! cannot determine board type!\n");
return -EINVAL;
printk("%s ", dev->board_name);
/* Enable device and reserve I/O spaces. */
+#ifdef CONFIG_COMEDI_PCI
if (pci_dev) {
if ((ret = comedi_pci_enable(pci_dev, PC236_DRIVER_NAME)) < 0) {
printk("error enabling PCI device and requesting regions!\n");
devpriv->lcr_iobase = pci_resource_start(pci_dev, 1);
iobase = pci_resource_start(pci_dev, 2);
irq = pci_dev->irq;
- } else {
+ } else
+#endif
+ {
if ((ret = pc236_request_region(iobase, PC236_IO_SIZE)) < 0) {
return ret;
}
if (thisboard->bustype == isa_bustype) {
printk("(base %#lx) ", iobase);
} else {
+#ifdef CONFIG_COMEDI_PCI
printk("(pci %s) ", pci_name(pci_dev));
+#endif
}
if (irq) {
printk("(irq %u%s) ", irq, (dev->irq ? "" : " UNAVAILABLE"));
subdev_8255_cleanup(dev, dev->subdevices + 0);
}
if (devpriv) {
+#ifdef CONFIG_COMEDI_PCI
if (devpriv->pci_dev) {
if (dev->iobase) {
comedi_pci_disable(devpriv->pci_dev);
}
pci_dev_put(devpriv->pci_dev);
- } else if (dev->iobase) {
- release_region(dev->iobase, PC236_IO_SIZE);
+ } else
+#endif
+ {
+ if (dev->iobase) {
+ release_region(dev->iobase, PC236_IO_SIZE);
+ }
}
}
return 0;
comedi_spin_lock_irqsave(&dev->spinlock, flags);
devpriv->enable_irq = 0;
+#ifdef CONFIG_COMEDI_PCI
if (devpriv->lcr_iobase)
outl(PCI236_INTR_DISABLE, devpriv->lcr_iobase + PLX9052_INTCSR);
+#endif
comedi_spin_unlock_irqrestore(&dev->spinlock, flags);
}
comedi_spin_lock_irqsave(&dev->spinlock, flags);
devpriv->enable_irq = 1;
+#ifdef CONFIG_COMEDI_PCI
if (devpriv->lcr_iobase)
outl(PCI236_INTR_ENABLE, devpriv->lcr_iobase + PLX9052_INTCSR);
+#endif
comedi_spin_unlock_irqrestore(&dev->spinlock, flags);
}
bustype: isa_bustype,
model: pc263_model,
},
+#ifdef CONFIG_COMEDI_PCI
{
name: "pci263",
fancy_name:"PCI263",
bustype: pci_bustype,
model: pci263_model,
},
+#endif
};
+#ifdef CONFIG_COMEDI_PCI
static struct pci_device_id pc263_pci_table[] __devinitdata = {
{PCI_VENDOR_ID_AMPLICON, PCI_DEVICE_ID_AMPLICON_PCI263, PCI_ANY_ID,
PCI_ANY_ID, 0, 0, pci263_model},
};
MODULE_DEVICE_TABLE(pci, pc263_pci_table);
+#endif /* CONFIG_COMEDI_PCI */
/*
* Useful for shorthand access to the particular board structure
/* this structure is for data unique to this hardware driver. If
several hardware drivers keep similar information in this structure,
feel free to suggest moving the variable to the comedi_device struct. */
+#ifdef CONFIG_COMEDI_PCI
typedef struct {
/* PCI device. */
struct pci_dev *pci_dev;
} pc263_private;
#define devpriv ((pc263_private *)dev->private)
+#endif /* CONFIG_COMEDI_PCI */
/*
* The comedi_driver structure tells the Comedi core module
static int pc263_attach(comedi_device * dev, comedi_devconfig * it)
{
comedi_subdevice *s;
- struct pci_dev *pci_dev = NULL;
unsigned long iobase = 0;
+#ifdef CONFIG_COMEDI_PCI
+ struct pci_dev *pci_dev = NULL;
int bus = 0, slot = 0;
struct pci_device_id *pci_id;
+#endif
int ret;
printk("comedi%d: %s: ", dev->minor, PC263_DRIVER_NAME);
* Allocate the private structure area. alloc_private() is a
* convenient macro defined in comedidev.h.
*/
+#ifdef CONFIG_COMEDI_PCI
if ((ret = alloc_private(dev, sizeof(pc263_private))) < 0) {
printk("out of memory!\n");
return ret;
}
+#endif
/* Process options. */
switch (thisboard->bustype) {
case isa_bustype:
iobase = it->options[0];
break;
+#ifdef CONFIG_COMEDI_PCI
case pci_bustype:
bus = it->options[0];
slot = it->options[1];
return -EIO;
}
break;
+#endif /* CONFIG_COMEDI_PCI */
default:
printk("bug! cannot determine board type!\n");
return -EINVAL;
printk("%s ", dev->board_name);
/* Enable device and reserve I/O spaces. */
+#ifdef CONFIG_COMEDI_PCI
if (pci_dev) {
if ((ret = comedi_pci_enable(pci_dev, PC263_DRIVER_NAME)) < 0) {
printk("error enabling PCI device and requesting regions!\n");
return ret;
}
iobase = pci_resource_start(pci_dev, 2);
- } else {
+ } else
+#endif
+ {
if ((ret = pc263_request_region(iobase, PC263_IO_SIZE)) < 0) {
return ret;
}
if (thisboard->bustype == isa_bustype) {
printk("(base %#lx) ", iobase);
} else {
+#ifdef CONFIG_COMEDI_PCI
printk("(pci %s) ", pci_name(pci_dev));
+#endif
}
printk("attached\n");
{
printk("comedi%d: %s: remove\n", dev->minor, PC263_DRIVER_NAME);
- if (devpriv) {
+#ifdef CONFIG_COMEDI_PCI
+ if (devpriv)
+#endif
+ {
+#ifdef CONFIG_COMEDI_PCI
if (devpriv->pci_dev) {
if (dev->iobase) {
comedi_pci_disable(devpriv->pci_dev);
}
pci_dev_put(devpriv->pci_dev);
- } else if (dev->iobase) {
- release_region(dev->iobase, PC263_IO_SIZE);
+ } else
+#endif
+ {
+ if (dev->iobase) {
+ release_region(dev->iobase, PC263_IO_SIZE);
+ }
}
}
comedi_insn * insn, lsampl_t * data);
static unsigned int labpc_suggest_transfer_size(comedi_cmd cmd);
static void labpc_adc_timing(comedi_device * dev, comedi_cmd * cmd);
+#ifdef CONFIG_COMEDI_PCI
static struct mite_struct *labpc_find_device(int bus, int slot);
+#endif
static int labpc_dio_mem_callback(int dir, int port, int data,
unsigned long arg);
static void labpc_serial_out(comedi_device * dev, unsigned int value,
ai_scan_up:0,
memory_mapped_io:0,
},
+#ifdef CONFIG_COMEDI_PCI
{
name: "pci-1200",
device_id:0x161,
ai_scan_up:1,
memory_mapped_io:1,
},
+#endif
};
/*
offset:sizeof(labpc_board),
};
+#ifdef CONFIG_COMEDI_PCI
static struct pci_device_id labpc_pci_table[] __devinitdata = {
{PCI_VENDOR_ID_NATINST, 0x161, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{0}
};
MODULE_DEVICE_TABLE(pci, labpc_pci_table);
+#endif /* CONFIG_COMEDI_PCI */
static inline int labpc_counter_load(comedi_device * dev,
unsigned long base_address, unsigned int counter_number,
unsigned long iobase = 0;
unsigned int irq = 0;
unsigned int dma_chan = 0;
- int ret;
/* allocate and initialize dev->private */
if (alloc_private(dev, sizeof(labpc_private)) < 0)
dma_chan = it->options[2];
break;
case pci_bustype:
+#ifdef CONFIG_COMEDI_PCI
devpriv->mite =
labpc_find_device(it->options[0], it->options[1]);
if (devpriv->mite == NULL) {
printk("bug! mite device id does not match boardtype definition\n");
return -EINVAL;
}
- ret = mite_setup(devpriv->mite);
- if (ret < 0)
- return ret;
+ {
+ int ret = mite_setup(devpriv->mite);
+ if (ret < 0)
+ return ret;
+ }
iobase = (unsigned long)devpriv->mite->daq_io_addr;
irq = mite_irq(devpriv->mite);
+#else
+ printk(" this driver has not been built with PCI support.\n");
+ return -EINVAL;
+#endif
break;
case pcmcia_bustype:
printk(" this driver does not support pcmcia cards, use ni_labpc_cs.o\n");
}
// adapted from ni_pcimio for finding mite based boards (pc-1200)
+#ifdef CONFIG_COMEDI_PCI
static struct mite_struct *labpc_find_device(int bus, int slot)
{
struct mite_struct *mite;
mite_list_devices();
return NULL;
}
+#endif
int labpc_common_detach(comedi_device * dev)
{
comedi_free_irq(dev->irq, dev);
if (thisboard->bustype == isa_bustype && dev->iobase)
release_region(dev->iobase, LABPC_SIZE);
+#ifdef CONFIG_COMEDI_PCI
if (devpriv->mite)
mite_unsetup(devpriv->mite);
+#endif
return 0;
};
}
// e-series boards use the second irq signals to generate dma requests for their counters
+#ifdef PCIDMA
static void ni_e_series_enable_second_irq(comedi_device * dev,
unsigned gpct_index, short enable)
{
break;
}
}
+#endif // PCIDMA
static void ni_clear_ai_fifo(comedi_device * dev)
{
unsigned int ai_mite_status = 0;
unsigned int ao_mite_status = 0;
unsigned long flags;
+#ifdef PCIDMA
struct mite_struct *mite = devpriv->mite;
+#endif
if (dev->attached == 0)
return IRQ_NONE;
comedi_spin_lock_irqsave(&dev->spinlock, flags);
a_status = devpriv->stc_readw(dev, AI_Status_1_Register);
b_status = devpriv->stc_readw(dev, AO_Status_1_Register);
+#ifdef PCIDMA
if (mite) {
unsigned long flags_too;
comedi_spin_unlock_irqrestore(&devpriv->mite_channel_lock,
flags_too);
}
+#endif
ack_a_interrupt(dev, a_status);
ack_b_interrupt(dev, b_status);
if ((a_status & Interrupt_A_St) || (ai_mite_status & CHSR_INT))
static void handle_gpct_interrupt(comedi_device * dev,
unsigned short counter_index)
{
+#ifdef PCIDMA
comedi_subdevice *s = dev->subdevices + NI_GPCT_SUBDEV(counter_index);
ni_tio_handle_interrupt(&devpriv->counter_dev->counters[counter_index],
s);
if (s->async->events)
ni_event(dev, s);
+#endif
}
static void ack_a_interrupt(comedi_device * dev, unsigned short a_status)
static int ni_cdo_inttrig(comedi_device * dev, comedi_subdevice * s,
unsigned int trignum)
{
+#ifdef PCIDMA
unsigned long flags;
+#endif
int retval = 0;
unsigned i;
const unsigned timeout = 100;
/* read alloc the entire buffer */
comedi_buf_read_alloc(s->async, s->async->prealloc_bufsz);
+#ifdef PCIDMA
comedi_spin_lock_irqsave(&devpriv->mite_channel_lock, flags);
if (devpriv->cdo_mite_chan) {
mite_prep_dma(devpriv->cdo_mite_chan, 32, 32);
comedi_spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
if (retval < 0)
return retval;
+#endif
// XXX not sure what interrupt C group does
// ni_writeb(Interrupt_Group_C_Enable_Bit, M_Offset_Interrupt_C_Enable);
//wait for dma to fill output fifo
}
ni_writel(CDO_Arm_Bit | CDO_Error_Interrupt_Enable_Set_Bit |
CDO_Empty_FIFO_Interrupt_Enable_Set_Bit, M_Offset_CDIO_Command);
- return 0;
+ return retval;
}
static int ni_cdio_cancel(comedi_device * dev, comedi_subdevice * s)
{
unsigned cdio_status;
comedi_subdevice *s = dev->subdevices + NI_DIO_SUBDEV;
+#ifdef PCIDMA
unsigned long flags;
+#endif
if ((boardtype.reg_type & ni_reg_m_series_mask) == 0) {
return;
}
+#ifdef PCIDMA
comedi_spin_lock_irqsave(&devpriv->mite_channel_lock, flags);
if (devpriv->cdo_mite_chan) {
unsigned cdo_mite_status =
mite_sync_output_dma(devpriv->cdo_mite_chan, s->async);
}
comedi_spin_unlock_irqrestore(&devpriv->mite_channel_lock, flags);
+#endif
cdio_status = ni_readl(M_Offset_CDIO_Status);
if (cdio_status & (CDO_Overrun_Bit | CDO_Underflow_Bit)) {
static int ni_gpct_cmdtest(comedi_device * dev, comedi_subdevice * s,
comedi_cmd * cmd)
{
+#ifdef PCIDMA
struct ni_gpct *counter = s->private;
return ni_tio_cmdtest(counter, cmd);
+#else
+ return -ENOTSUPP;
+#endif
}
static int ni_gpct_cancel(comedi_device * dev, comedi_subdevice * s)
{
+#ifdef PCIDMA
struct ni_gpct *counter = s->private;
int retval;
ni_e_series_enable_second_irq(dev, counter->counter_index, 0);
ni_release_gpct_mite_channel(dev, counter->counter_index);
return retval;
+#else
+ return 0;
+#endif
}
/*
return 0;
}
+#ifdef CONFIG_COMEDI_PCI
static void ni_tio_configure_dma(struct ni_gpct *counter, short enable,
short read_not_write)
{
break;
}
}
+#endif
+#ifdef CONFIG_COMEDI_PCI
static int ni_tio_input_inttrig(comedi_device * dev, comedi_subdevice * s,
unsigned int trignum)
{
return retval;
}
+#endif
+#ifdef CONFIG_COMEDI_PCI
static int ni_tio_input_cmd(struct ni_gpct *counter, comedi_async * async)
{
struct ni_gpct_device *counter_dev = counter->counter_dev;
}
return retval;
}
+#endif
+#ifdef CONFIG_COMEDI_PCI
static int ni_tio_output_cmd(struct ni_gpct *counter, comedi_async * async)
{
rt_printk("ni_tio: output commands not yet implemented.\n");
mite_dma_arm(counter->mite_chan);
return ni_tio_arm(counter, 1, NI_GPCT_ARM_IMMEDIATE);
}
+#endif
+#ifdef CONFIG_COMEDI_PCI
static int ni_tio_cmd_setup(struct ni_gpct *counter, comedi_async * async)
{
comedi_cmd *cmd = &async->cmd;
}
return retval;
}
+#endif
+#ifdef CONFIG_COMEDI_PCI
int ni_tio_cmd(struct ni_gpct *counter, comedi_async * async)
{
comedi_cmd *cmd = &async->cmd;
comedi_spin_unlock_irqrestore(&counter->lock, flags);
return retval;
}
+#endif
+#ifdef CONFIG_COMEDI_PCI
int ni_tio_cmdtest(struct ni_gpct *counter, comedi_cmd * cmd)
{
int err = 0;
return 0;
}
+#endif
+#ifdef CONFIG_COMEDI_PCI
int ni_tio_cancel(struct ni_gpct *counter)
{
unsigned long flags;
Gi_Gate_Interrupt_Enable_Bit(counter->counter_index), 0x0);
return 0;
}
+#endif
/* During buffered input counter operation for e-series, the gate interrupt is acked
automatically by the dma controller, due to the Gi_Read/Write_Acknowledges_IRQ bits
in the input select register. */
+#ifdef CONFIG_COMEDI_PCI
static int should_ack_gate(struct ni_gpct *counter)
{
unsigned long flags;
}
return retval;
}
+#endif
+#ifdef CONFIG_COMEDI_PCI
void ni_tio_acknowledge_and_confirm(struct ni_gpct *counter, int *gate_error,
int *tc_error, int *perm_stale_data, int *stale_data)
{
}
}
}
+#endif
+#ifdef CONFIG_COMEDI_PCI
void ni_tio_handle_interrupt(struct ni_gpct *counter, comedi_subdevice * s)
{
unsigned gpct_mite_status;
mite_sync_input_dma(counter->mite_chan, s->async);
comedi_spin_unlock_irqrestore(&counter->lock, flags);
}
+#endif
+#ifdef CONFIG_COMEDI_PCI
void ni_tio_set_mite_channel(struct ni_gpct *counter,
struct mite_channel *mite_chan)
{
counter->mite_chan = mite_chan;
comedi_spin_unlock_irqrestore(&counter->lock, flags);
}
+#endif
EXPORT_SYMBOL_GPL(ni_tio_rinsn);
EXPORT_SYMBOL_GPL(ni_tio_winsn);
+#ifdef CONFIG_COMEDI_PCI
EXPORT_SYMBOL_GPL(ni_tio_cmd);
EXPORT_SYMBOL_GPL(ni_tio_cmdtest);
EXPORT_SYMBOL_GPL(ni_tio_cancel);
+#endif
EXPORT_SYMBOL_GPL(ni_tio_insn_config);
EXPORT_SYMBOL_GPL(ni_tio_init_counter);
EXPORT_SYMBOL_GPL(ni_gpct_device_construct);
EXPORT_SYMBOL_GPL(ni_gpct_device_destroy);
+#ifdef CONFIG_COMEDI_PCI
EXPORT_SYMBOL_GPL(ni_tio_handle_interrupt);
EXPORT_SYMBOL_GPL(ni_tio_set_mite_channel);
EXPORT_SYMBOL_GPL(ni_tio_acknowledge_and_confirm);
+#endif
-DKBUILD_BASENAME=\$(shell basename \$< .c)"]
AC_SUBST(COMEDI_CFLAGS)
+AS_CHECK_LINUX_CONFIG_OPTION([CONFIG_PCI],[HAVE_PCI="yes"],[HAVE_PCI="yes"],[HAVE_PCI="no"])
+AM_CONDITIONAL([CONFIG_PCI],[test "$HAVE_PCI" = "yes"])
+AC_ARG_ENABLE([pci],[ --disable-pci Disable support for PCI devices],
+ [ENABLE_PCI=$enableval],[ENABLE_PCI="maybe"])
+if test "$HAVE_PCI" = "yes" ; then
+ if test "ENABLE_PCI" = "no" ; then
+ AC_MSG_NOTICE([PCI support disabled])
+ USE_PCI="no"
+ else
+ AC_DEFINE([CONFIG_COMEDI_PCI],[true],[Define if PCI support is enabled])
+ USE_PCI="yes"
+ fi
+else
+ if test "ENABLE_PCI" = "yes" ; then
+ AC_MSG_ERROR([Kernel does not support PCI])
+ fi
+ USE_PCI="no"
+fi
+AM_CONDITIONAL([CONFIG_COMEDI_PCI],[test "$USE_PCI" = "yes"])
+
COMEDI_CHECK_PCMCIA_PROBE([$LINUX_SRC_DIR], [HAVE_PCMCIA="yes"], [HAVE_PCMCIA="no"])
AM_CONDITIONAL([CONFIG_PCMCIA],[test "$HAVE_PCMCIA" = "yes"])
AC_ARG_ENABLE([pcmcia],[ --disable-pcmcia Disable support for PCMCIA devices],
AM_CONDITIONAL([CONFIG_KBUILD], [test ${ENABLE_KBUILD} = "yes"])
COMEDI_CHECK_HAVE_MUTEX_H([$LINUX_SRC_DIR], [HAVE_MUTEX_H="yes"], [HAVE_MUTEX_H="no"])
AS_LINUX_CONFIG_OPTION_MODULE(CONFIG_ISA)
-AS_LINUX_CONFIG_OPTION_MODULE(CONFIG_PCI)
AC_DEFINE(CONFIG_COMEDI_DEBUG, true, [Define if debugging is enabled])
AC_DEFINE(CONFIG_COMEDI_8255, true, [Define if 8255 support is enabled])