42 #include <linux/slab.h>
43 #include "../comedidev.h"
52 #define DAS16CS_SIZE 18
54 #define DAS16CS_ADC_DATA 0
55 #define DAS16CS_DIO_MUX 2
56 #define DAS16CS_MISC1 4
57 #define DAS16CS_MISC2 6
58 #define DAS16CS_CTR0 8
59 #define DAS16CS_CTR1 10
60 #define DAS16CS_CTR2 12
61 #define DAS16CS_CTR_CONTROL 14
62 #define DAS16CS_DIO 16
72 .name =
"PC-CARD DAS16/16-AO",
76 .name =
"PCM-DAS16s/16",
80 .name =
"PC-CARD DAS16/16",
92 static struct pcmcia_device *cur_dev;
143 for (i = 0; i < insn->
n; i++) {
147 for (to = 0; to <
TIMEOUT; to++) {
189 err |= cfc_check_trigger_is_unique(cmd->
convert_src);
190 err |= cfc_check_trigger_is_unique(cmd->
stop_src);
203 #define MAX_SPEED 10000
204 #define MIN_SPEED 1000000000
265 unsigned int div1 = 0,
div2 = 0;
275 unsigned int div1 = 0,
div2 = 0;
309 for (i = 0; i < insn->
n; i++) {
316 status1 = devpriv->
status1 & ~0xf;
325 for (bit = 15; bit >= 0; bit--) {
326 int b = (d >>
bit) & 0x1;
351 for (i = 0; i < insn->
n; i++)
362 s->
state &= ~data[0];
363 s->
state |= data[0] & data[1];
373 static int das16cs_dio_insn_config(
struct comedi_device *dev,
413 struct pcmcia_device *
link)
417 for (i = 0; i <
ARRAY_SIZE(das16cs_boards); i++) {
418 if (das16cs_boards[i].
device_id == link->card_id)
419 return das16cs_boards +
i;
431 struct pcmcia_device *
link;
439 dev->
board_ptr = das16cs_probe(dev, link);
442 thisboard = comedi_board(dev);
446 dev->
iobase = link->resource[0]->start;
452 dev->
irq = link->irq;
471 s->
do_cmd = das16cs_ai_cmd;
512 .driver_name =
"cb_das16_cs",
514 .attach = das16cs_attach,
515 .detach = das16cs_detach,
518 static int das16cs_pcmcia_config_loop(
struct pcmcia_device *p_dev,
521 if (p_dev->config_index == 0)
527 static int das16cs_pcmcia_attach(
struct pcmcia_device *link)
532 link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
534 ret = pcmcia_loop_config(link, das16cs_pcmcia_config_loop,
NULL);
553 static void das16cs_pcmcia_detach(
struct pcmcia_device *link)
560 PCMCIA_DEVICE_MANF_CARD(0x01c5, 0x0039),
561 PCMCIA_DEVICE_MANF_CARD(0x01c5, 0x4009),
566 static struct pcmcia_driver das16cs_driver = {
567 .name =
"cb_das16_cs",
569 .probe = das16cs_pcmcia_attach,
570 .remove = das16cs_pcmcia_detach,
571 .id_table = das16cs_id_table,
574 static int __init das16cs_init(
void)
592 static void __exit das16cs_exit(
void)