#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
#include <pcmcia/cs_types.h>
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
#include <pcmcia/cs.h>
+#endif
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
link->irq.Handler = NULL;
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
link->conf.Attributes = 0;
link->conf.IntType = INT_MEMORY_AND_IO;
+#endif
cur_dev = link;
} /* das16cs_pcmcia_detach */
#ifdef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
+#ifdef CONFIG_COMEDI_HAVE_CS_H
static int das16cs_pcmcia_config_loop(struct pcmcia_device *p_dev,
cistpl_cftable_entry_t *cfg,
cistpl_cftable_entry_t *dflt,
return 0;
}
-#endif
+#else /* CONFIG_COMEDI_HAVE_CS_H */
+static int das16cs_pcmcia_config_loop(struct pcmcia_device *p_dev,
+ void *priv_data)
+{
+ if (p_dev->config_index == 0)
+ return -EINVAL;
+
+ return pcmcia_request_io(p_dev);
+}
+#endif /* CONFIG_COMEDI_HAVE_CS_H */
+#endif /* CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE */
static void das16cs_pcmcia_config(struct pcmcia_device *link)
{
DEBUG(0, "das16cs_pcmcia_config(0x%p)\n", link);
+#ifndef CONFIG_COMEDI_HAVE_CS_H
+ /* Do we need to allocate an interrupt? */
+ link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
+#endif
+
#ifdef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
last_ret = pcmcia_loop_config(link, das16cs_pcmcia_config_loop, NULL);
if (last_ret) {
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
last_fn = RequestConfiguration;
#endif
- if ((last_ret = pcmcia_request_configuration(link, &link->conf)) != 0)
+#ifdef CONFIG_COMEDI_HAVE_CS_H
+ last_ret = pcmcia_request_configuration(link, &link->conf);
+#else
+ last_ret = pcmcia_enable_device(link);
+#endif
+ if (last_ret)
goto cs_failed;
#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
link->dev_node = &dev->node;
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
/* Finally, report what we've done */
#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
printk(KERN_INFO "%s: index 0x%02x",
printk(" & %pR", link->resource[1]);
#endif
printk("\n");
+#endif /* CONFIG_COMEDI_HAVE_CS_H */
return;
.resume = das16cs_pcmcia_resume,
.id_table = das16cs_id_table,
.owner = THIS_MODULE,
+#ifdef CONFIG_COMEDI_HAVE_PCMCIA_DRIVER_NAME
+ .name = devname,
+#else
.drv = {
.name = devname,
},
+#endif
};
static int __init init_das16cs_pcmcia_cs(void)
#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
#include <pcmcia/cs_types.h>
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
#include <pcmcia/cs.h>
+#endif
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
link->irq.Handler = NULL;
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
/*
General socket configuration defaults can go here. In this
client, we assume very little, and rely on the CIS for almost
*/
link->conf.Attributes = 0;
link->conf.IntType = INT_MEMORY_AND_IO;
+#endif
cur_dev = link;
======================================================================*/
#ifdef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
+#ifdef CONFIG_COMEDI_HAVE_CS_H
static int das08_pcmcia_config_loop(struct pcmcia_device *p_dev,
cistpl_cftable_entry_t *cfg,
cistpl_cftable_entry_t *dflt,
#endif
return 0;
}
-#endif
+#else /* CONFIG_COMEDI_HAVE_CS_H */
+static int das08_pcmcia_config_loop(struct pcmcia_device *p_dev,
+ void *priv_data)
+{
+ if (p_dev->config_index == 0)
+ return -EINVAL;
+
+ return pcmcia_request_io(p_dev);
+}
+#endif /* CONFIG_COMEDI_HAVE_CS_H */
+#endif /* CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE */
static void das08_pcmcia_config(struct pcmcia_device *link)
{
DEBUG(0, "das08_pcmcia_config(0x%p)\n", link);
+#ifndef CONFIG_COMEDI_HAVE_CS_H
+ /* Do we need to allocate an interrupt? */
+ link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
+#endif
+
#ifdef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
last_ret = pcmcia_loop_config(link, das08_pcmcia_config_loop, NULL);
if (last_ret) {
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
last_fn = RequestConfiguration;
#endif
- if ((last_ret = pcmcia_request_configuration(link, &link->conf)) != 0)
+#ifdef CONFIG_COMEDI_HAVE_CS_H
+ last_ret = pcmcia_request_configuration(link, &link->conf);
+#else
+ last_ret = pcmcia_enable_device(link);
+#endif
+ if (last_ret)
goto cs_failed;
#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
link->dev_node = &dev->node;
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
/* Finally, report what we've done */
#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
printk(KERN_INFO "%s: index 0x%02x",
printk(" & %pR", link->resource[1]);
#endif
printk("\n");
+#endif /* CONFIG_COMEDI_HAVE_CS_H */
return;
.resume = das08_pcmcia_resume,
.id_table = das08_cs_id_table,
.owner = THIS_MODULE,
+#ifdef CONFIG_COMEDI_HAVE_PCMCIA_DRIVER_NAME
+ .name = devname,
+#else
.drv = {
.name = devname,
},
+#endif
};
static int __init init_das08_pcmcia_cs(void)
#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
#include <pcmcia/cs_types.h>
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
#include <pcmcia/cs.h>
+#endif
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
#include <pcmcia/ds.h>
return 0;
};
-// PCMCIA crap
-
/*
All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
you do not define PCMCIA_DEBUG at all, all the debug code will be
link->irq.Handler = NULL;
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
/*
General socket configuration defaults can go here. In this
client, we assume very little, and rely on the CIS for almost
*/
link->conf.Attributes = 0;
link->conf.IntType = INT_MEMORY_AND_IO;
+#endif
pcmcia_cur_dev = link;
======================================================================*/
#ifdef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
+#ifdef CONFIG_COMEDI_HAVE_CS_H
static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev,
cistpl_cftable_entry_t *cfg,
cistpl_cftable_entry_t *dflt,
/* If we got this far, we're cool! */
return 0;
}
-#endif
+#else /* CONFIG_COMEDI_HAVE_CS_H */
+static int dio700_pcmcia_config_loop(struct pcmcia_device *p_dev,
+ void *priv_data)
+{
+ if (p_dev->config_index == 0)
+ return -EINVAL;
+
+ return pcmcia_request_io(p_dev);
+}
+#endif /* CONFIG_COMEDI_HAVE_CS_H */
+#endif /* CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE */
static void dio700_config(struct pcmcia_device *link)
{
local_info_t *dev = link->priv;
#endif
int last_ret;
+#ifdef CONFIG_COMEDI_HAVE_CS_H
win_req_t req;
+#endif
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
tuple_t tuple;
cisparse_t parse;
DEBUG(0, "dio700_config(0x%p)\n", link);
+#ifndef CONFIG_COMEDI_HAVE_CS_H
+ link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_AUDIO |
+ CONF_AUTO_SET_IO;
+#endif
+
#ifdef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
- last_ret = pcmcia_loop_config(link, dio700_pcmcia_config_loop, &req);
+ last_ret = pcmcia_loop_config(link, dio700_pcmcia_config_loop,
+#ifdef CONFIG_COMEDI_HAVE_CS_H
+ &req
+#else
+ NULL
+#endif
+ );
if (last_ret) {
dev_warn(&link->dev, "no configuration found\n");
goto cs_failed;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
last_fn = RequestConfiguration;
#endif
- if ((last_ret = pcmcia_request_configuration(link, &link->conf)) != 0) {
+#ifdef CONFIG_COMEDI_HAVE_CS_H
+ last_ret = pcmcia_request_configuration(link, &link->conf);
+#else
+ last_ret = pcmcia_enable_device(link);
+#endif
+ if (last_ret)
goto cs_failed;
- }
#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
/*
link->dev_node = &dev->node;
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
/* Finally, report what we've done */
#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
printk(KERN_INFO "%s: index 0x%02x",
printk(", mem 0x%06lx-0x%06lx", req.Base,
req.Base + req.Size - 1);
printk("\n");
+#endif /* CONFIG_COMEDI_HAVE_CS_H */
return;
.resume = dio700_cs_resume,
.id_table = dio700_cs_ids,
.owner = THIS_MODULE,
+#ifdef CONFIG_COMEDI_HAVE_PCMCIA_DRIVER_NAME
+ .name = devname,
+#else
.drv = {
.name = devname,
},
+#endif
};
static int __init init_dio700_cs(void)
Driver for National Instruments PCMCIA DAQ-Card DIO-24
Copyright (C) 2002 Daniel Vecino Castel <dvecino@able.es>
- PCMCIA crap at end of file is adapted from dummy_cs.c 1.31 2001/08/24 12:13:13
+ PCMCIA stuff at end of file is adapted from dummy_cs.c 1.31 2001/08/24 12:13:13
from the pcmcia package.
The initial developer of the pcmcia dummy_cs.c code is David A. Hinds
<dahinds@users.sourceforge.net>. Portions created by David A. Hinds
#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
#include <pcmcia/cs_types.h>
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
#include <pcmcia/cs.h>
+#endif
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
#include <pcmcia/ds.h>
return 0;
};
-// PCMCIA crap
-
/*
All the PCMCIA modules use PCMCIA_DEBUG to control debugging. If
you do not define PCMCIA_DEBUG at all, all the debug code will be
link->irq.Handler = NULL;
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
/*
General socket configuration defaults can go here. In this
client, we assume very little, and rely on the CIS for almost
*/
link->conf.Attributes = 0;
link->conf.IntType = INT_MEMORY_AND_IO;
+#endif
pcmcia_cur_dev = link;
======================================================================*/
#ifdef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
+#ifdef CONFIG_COMEDI_HAVE_CS_H
static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev,
cistpl_cftable_entry_t *cfg,
cistpl_cftable_entry_t *dflt,
/* If we got this far, we're cool! */
return 0;
}
-#endif
+#else /* CONFIG_COMEDI_HAVE_CS_H */
+static int dio24_pcmcia_config_loop(struct pcmcia_device *p_dev,
+ void *priv_data)
+{
+ if (p_dev->config_index == 0)
+ return -EINVAL;
+
+ return pcmcia_request_io(p_dev);
+}
+#endif /* CONFIG_COMEDI_HAVE_CS_H */
+#endif /* CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE */
static void dio24_config(struct pcmcia_device *link)
{
local_info_t *dev = link->priv;
#endif
int last_ret;
+#ifdef CONFIG_COMEDI_HAVE_CS_H
win_req_t req;
+#endif
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
tuple_t tuple;
cisparse_t parse;
DEBUG(0, "dio24_config(0x%p)\n", link);
+#ifndef CONFIG_COMEDI_HAVE_CS_H
+ link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_AUDIO |
+ CONF_AUTO_SET_IO;
+#endif
+
#ifdef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
- last_ret = pcmcia_loop_config(link, dio24_pcmcia_config_loop, &req);
+ last_ret = pcmcia_loop_config(link, dio24_pcmcia_config_loop,
+#ifdef CONFIG_COMEDI_HAVE_CS_H
+ &req
+#else
+ NULL
+#endif
+ );
if (last_ret) {
dev_warn(&link->dev, "no configuration found\n");
goto cs_failed;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
last_fn = RequestConfiguration;
#endif
- if ((last_ret = pcmcia_request_configuration(link, &link->conf)) != 0) {
+#ifdef CONFIG_COMEDI_HAVE_CS_H
+ last_ret = pcmcia_request_configuration(link, &link->conf);
+#else
+ last_ret = pcmcia_enable_device(link);
+#endif
+ if (last_ret)
goto cs_failed;
- }
#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
/*
link->dev_node = &dev->node;
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
/* Finally, report what we've done */
#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
printk(KERN_INFO "%s: index 0x%02x",
printk(", mem 0x%06lx-0x%06lx", req.Base,
req.Base + req.Size - 1);
printk("\n");
+#endif /* CONFIG_COMEDI_HAVE_CS_H */
return;
.resume = dio24_cs_resume,
.id_table = dio24_cs_ids,
.owner = THIS_MODULE,
+#ifdef CONFIG_COMEDI_HAVE_PCMCIA_DRIVER_NAME
+ .name = devname,
+#else
.drv = {
.name = devname,
},
+#endif
};
static int __init init_dio24_cs(void)
Driver for National Instruments daqcard-1200 boards
Copyright (C) 2001, 2002, 2003 Frank Mori Hess <fmhess@users.sourceforge.net>
- PCMCIA crap is adapted from dummy_cs.c 1.31 2001/08/24 12:13:13
+ PCMCIA stuff is adapted from dummy_cs.c 1.31 2001/08/24 12:13:13
from the pcmcia package.
The initial developer of the pcmcia dummy_cs.c code is David A. Hinds
<dahinds@users.sourceforge.net>. Portions created by David A. Hinds
#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
#include <pcmcia/cs_types.h>
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
#include <pcmcia/cs.h>
+#endif
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
#include <pcmcia/ds.h>
link->irq.Handler = NULL;
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
/*
General socket configuration defaults can go here. In this
client, we assume very little, and rely on the CIS for almost
*/
link->conf.Attributes = 0;
link->conf.IntType = INT_MEMORY_AND_IO;
+#endif
pcmcia_cur_dev = link;
======================================================================*/
#ifdef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
+#ifdef CONFIG_COMEDI_HAVE_CS_H
static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
cistpl_cftable_entry_t *cfg,
cistpl_cftable_entry_t *dflt,
/* If we got this far, we're cool! */
return 0;
}
-#endif
+#else /* CONFIG_COMEDI_HAVE_CS_H */
+static int labpc_pcmcia_config_loop(struct pcmcia_device *p_dev,
+ void *priv_data)
+{
+ if (p_dev->config_index == 0)
+ return -EINVAL;
+
+ return pcmcia_request_io(p_dev);
+}
+#endif /* CONFIG_COMEDI_HAVE_CS_H */
+#endif /* CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE */
static void labpc_config(struct pcmcia_device *link)
{
local_info_t *dev = link->priv;
#endif
int last_ret;
+#ifdef CONFIG_COMEDI_HAVE_CS_H
win_req_t req;
+#endif
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
tuple_t tuple;
cisparse_t parse;
DEBUG(0, "labpc_config(0x%p)\n", link);
+#ifndef CONFIG_COMEDI_HAVE_CS_H
+ link->config_flags |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ |
+ CONF_AUTO_AUDIO | CONF_AUTO_SET_IO;
+#endif
+
#ifdef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
- last_ret = pcmcia_loop_config(link, labpc_pcmcia_config_loop, &req);
+ last_ret = pcmcia_loop_config(link, labpc_pcmcia_config_loop,
+#ifdef CONFIG_COMEDI_HAVE_CS_H
+ &req
+#else
+ NULL
+#endif
+ );
if (last_ret) {
dev_warn(&link->dev, "no configuration found\n");
goto cs_failed;
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
last_fn = RequestConfiguration;
#endif
- if ((last_ret = pcmcia_request_configuration(link, &link->conf))) {
+#ifdef CONFIG_COMEDI_HAVE_CS_H
+ last_ret = pcmcia_request_configuration(link, &link->conf);
+#else
+ last_ret = pcmcia_enable_device(link);
+#endif
+ if (last_ret)
goto cs_failed;
- }
#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
/*
link->dev_node = &dev->node;
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
/* Finally, report what we've done */
#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
printk(KERN_INFO "%s: index 0x%02x",
printk(", mem 0x%06lx-0x%06lx", req.Base,
req.Base + req.Size - 1);
printk("\n");
+#endif /* CONFIG_COMEDI_HAVE_CS_H */
return;
.resume = labpc_cs_resume,
.id_table = labpc_cs_ids,
.owner = THIS_MODULE,
+#ifdef CONFIG_COMEDI_HAVE_PCMCIA_DRIVER_NAME
+ .name = devname,
+#else
.drv = {
.name = devname,
},
+#endif
};
static int __init init_labpc_cs(void)
#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
#include <pcmcia/cs_types.h>
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
#include <pcmcia/cs.h>
+#endif
#include <pcmcia/cistpl.h>
#include <pcmcia/ds.h>
#endif
static int cs_attach(struct pcmcia_device *link)
{
+#ifdef CONFIG_COMEDI_HAVE_CS_H
#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
link->io.NumPorts1 = 16;
#endif
link->conf.Attributes = CONF_ENABLE_IRQ;
link->conf.IntType = INT_MEMORY_AND_IO;
+#endif
cur_dev = link;
#ifdef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
static int mio_pcmcia_config_loop(struct pcmcia_device *p_dev,
+#ifdef CONFIG_COMEDI_HAVE_CS_H
cistpl_cftable_entry_t *cfg,
cistpl_cftable_entry_t *dflt,
unsigned int vcc,
+#endif
void *priv_data)
{
int base, ret;
+#ifdef CONFIG_COMEDI_HAVE_CS_H
#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
p_dev->io.NumPorts1 = cfg->io.win[0].len;
p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK;
p_dev->resource[0]->end = cfg->io.win[0].len;
p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK;
#endif
+#else
+ p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+ p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
+#endif
for (base = 0x000; base < 0x400; base += 0x20) {
#ifdef CONFIG_COMEDI_HAVE_CS_IO_REQ_T
DPRINTK("mio_cs_config(link=%p)\n", link);
+#ifndef CONFIG_COMEDI_HAVE_CS_H
+ link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
+#endif
+
#ifdef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
ret = pcmcia_loop_config(link, mio_pcmcia_config_loop, NULL);
if (ret) {
link->conf.ConfigIndex = 1;
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
ret = pcmcia_request_configuration(link, &link->conf);
//printk("RequestConfiguration %d\n",ret);
+#else
+ ret = pcmcia_enable_device(link);
+#endif
#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
link->dev_node = &dev_node;
.resume = &mio_cs_resume,
.id_table = ni_mio_cs_ids,
.owner = THIS_MODULE,
+#ifdef CONFIG_COMEDI_HAVE_PCMCIA_DRIVER_NAME
+ .name = devname,
+#else
.drv = {
.name = devname,
},
+#endif
};
int init_module(void)
#ifdef CONFIG_COMEDI_HAVE_CS_TYPES_H
#include <pcmcia/cs_types.h>
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
#include <pcmcia/cs.h>
+#endif
#include <pcmcia/cistpl.h>
#include <pcmcia/cisreg.h>
#include <pcmcia/ds.h>
#endif
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
/*
General socket configuration defaults can go here. In this
client, we assume very little, and rely on the CIS for almost
*/
link->conf.Attributes = 0;
link->conf.IntType = INT_MEMORY_AND_IO;
+#endif
daqp_cs_config(link);
======================================================================*/
#ifdef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
+#ifdef CONFIG_COMEDI_HAVE_CS_H
static int daqp_pcmcia_config_loop(struct pcmcia_device *p_dev,
cistpl_cftable_entry_t *cfg,
cistpl_cftable_entry_t *dflt,
return pcmcia_request_io(p_dev);
#endif
}
-#endif
+#else /* CONFIG_COMEDI_HAVE_CS_H */
+static int daqp_pcmcia_config_loop(struct pcmcia_device *p_dev,
+ void *priv_data)
+{
+ if (p_dev->config_index == 0)
+ return -EINVAL;
+
+ return pcmcia_request_io(p_dev);
+}
+#endif /* CONFIG_COMEDI_HAVE_CS_H */
+#endif /* CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE */
static void daqp_cs_config(struct pcmcia_device *link)
{
DEBUG(0, "daqp_cs_config(0x%p)\n", link);
+#ifndef CONFIG_COMEDI_HAVE_CS_H
+ /* Do we need to allocate an interrupt? */
+ link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
+#endif
+
#ifdef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
last_ret = pcmcia_loop_config(link, daqp_pcmcia_config_loop, NULL);
if (last_ret) {
#ifndef CONFIG_COMEDI_HAVE_PCMCIA_LOOP_TUPLE
last_fn = RequestConfiguration;
#endif
- if ((last_ret = pcmcia_request_configuration(link, &link->conf))) {
+#ifdef CONFIG_COMEDI_HAVE_CS_H
+ last_ret = pcmcia_request_configuration(link, &link->conf);
+#else
+ last_ret = pcmcia_enable_device(link);
+#endif
+ if (last_ret)
goto cs_failed;
- }
#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
/*
link->dev_node = &dev->node;
#endif
+#ifdef CONFIG_COMEDI_HAVE_CS_H
/* Finally, report what we've done */
#ifdef CONFIG_COMEDI_HAVE_DS_DEV_NODE_T
printk(KERN_INFO "%s: index 0x%02x",
printk(" & %pR", link->resource[1]);
#endif
printk("\n");
+#endif /* CONFIG_COMEDI_HAVE_CS_H */
return;
.resume = daqp_cs_resume,
.id_table = daqp_cs_id_table,
.owner = THIS_MODULE,
+#ifdef CONFIG_COMEDI_HAVE_PCMCIA_DRIVER_NAME
+ .name = devname,
+#else
.drv = {
.name = devname,
},
+#endif
};
int __init init_module(void)
fi
AM_CONDITIONAL([CONFIG_COMEDI_PCI],[test "$USE_PCI" = "yes"])
-COMEDI_CHECK_PCMCIA_PROBE([$LINUX_SRC_DIR],
+COMEDI_CHECK_PCMCIA_DRIVER_PROBE([$LINUX_SRC_DIR],
[AS_CHECK_LINUX_CONFIG_OPTION([CONFIG_PCMCIA],
[HAVE_PCMCIA="yes"],[HAVE_PCMCIA="yes"],[HAVE_PCMCIA="no"])],
[HAVE_PCMCIA="no"])
fi
AM_CONDITIONAL([CONFIG_COMEDI_PCMCIA],[test "$USE_PCMCIA" = "yes"])
+COMEDI_CHECK_PCMCIA_DRIVER_NAME([$LINUX_SRC_DIR],
+ [HAVE_PCMCIA_DRIVER_NAME="yes"], [HAVE_PCMCIA_DRIVER_NAME="no"])
+if test "$HAVE_PCMCIA_DRIVER_NAME" = "yes" ; then
+ AC_DEFINE([CONFIG_COMEDI_HAVE_PCMCIA_DRIVER_NAME],[true],[Define if Linux kernel source has name member in struct pcmcia_driver])
+fi
+
COMEDI_CHECK_PCMCIA_LOOP_TUPLE([$LINUX_SRC_DIR],
[HAVE_PCMCIA_LOOP_TUPLE="yes"], [HAVE_PCMCIA_LOOP_TUPLE="no"])
if test "$HAVE_PCMCIA_LOOP_TUPLE" = "yes" ; then
AC_DEFINE([CONFIG_COMEDI_HAVE_CS_TYPES_H],[true],[Define if Linux kernel source has pcmcia/cs_types.h (removed in 2.6.36)])
fi
+COMEDI_CHECK_HAVE_CS_H([$LINUX_SRC_DIR],
+ [HAVE_CS_H="yes"], [HAVE_CS_H="no"])
+if test "$HAVE_CS_TYPES_H" = "yes" ; then
+ AC_DEFINE([CONFIG_COMEDI_HAVE_CS_H],[true],[Define if Linux kernel source has pcmcia/cs.h (removed in 2.6.37)])
+fi
+
AS_CHECK_LINUX_CONFIG_OPTION([CONFIG_USB],[HAVE_USB="yes"],[HAVE_USB="yes"],[HAVE_USB="no"])
AM_CONDITIONAL([CONFIG_USB],[test "$HAVE_USB" = "yes"])
AC_ARG_ENABLE([usb],[ --disable-usb Disable support for USB devices],
#
# Check if kernel pcmcia support is new enough to have a probe member in the pcmcia_driver
# struct.
-AC_DEFUN([COMEDI_CHECK_PCMCIA_PROBE],
+AC_DEFUN([COMEDI_CHECK_PCMCIA_DRIVER_PROBE],
[
AC_REQUIRE([AC_PROG_EGREP])
AC_MSG_CHECKING([$1 for probe in pcmcia_driver struct])
fi
])
+# COMEDI_CHECK_PCMCIA_DRIVER_NAME([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------------------
+#
+# Check if kernel pcmcia support is new enough to have a name member in the pcmcia_driver
+# struct.
+AC_DEFUN([COMEDI_CHECK_PCMCIA_DRIVER_NAME],
+[
+ AC_REQUIRE([AC_PROG_EGREP])
+ AC_MSG_CHECKING([$1 for name in pcmcia_driver struct])
+ cat "$1/include/pcmcia/ds.h" | tr \\n ' ' | [$EGREP "struct[[:space:]]+pcmcia_driver[[:space:]]*[{][^}]*name"] > /dev/null
+ if (($?)); then
+ AC_MSG_RESULT([no])
+ $3
+ else
+ AC_MSG_RESULT([yes])
+ $2
+ fi
+])
+
# COMEDI_CHECK_PCMCIA_LOOP_TUPLE([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# -------------------------------------------------------------
#
fi
])
+# COMEDI_CHECK_HAVE_CS_H([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# -------------------------------------------------------------
+#
+# Check if kernel has <pcmcia/cs.h> file.
+AC_DEFUN([COMEDI_CHECK_HAVE_CS_H],
+[
+ AC_MSG_CHECKING([$1 for include/pcmcia/cs.h (removed in 2.6.37)])
+ if test -f "$1/include/pcmcia/cs.h"; then
+ AC_MSG_RESULT([yes])
+ $2
+ else
+ AC_MSG_RESULT([no])
+ $3
+ fi
+])
+
# COMEDI_CHECK_HAVE_MUTEX_H([LINUX_SOURCE_PATH], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
# -------------------------------------------------------------
#