u16 eeprom_data[EEPROM_SIZE]; /* software copy of board's eeprom */
};
-/*
- * I will program this later... ;-)
- */
-#if 0
-static int cb_pcidda_ai_cmd(struct comedi_device *dev,
- struct comedi_subdevice *s)
-{
- printk("cb_pcidda_ai_cmd\n");
- printk("subdev: %d\n", cmd->subdev);
- printk("flags: %d\n", cmd->flags);
- printk("start_src: %d\n", cmd->start_src);
- printk("start_arg: %d\n", cmd->start_arg);
- printk("scan_begin_src: %d\n", cmd->scan_begin_src);
- printk("convert_src: %d\n", cmd->convert_src);
- printk("convert_arg: %d\n", cmd->convert_arg);
- printk("scan_end_src: %d\n", cmd->scan_end_src);
- printk("scan_end_arg: %d\n", cmd->scan_end_arg);
- printk("stop_src: %d\n", cmd->stop_src);
- printk("stop_arg: %d\n", cmd->stop_arg);
- printk("chanlist_len: %d\n", cmd->chanlist_len);
-}
-#endif
-
-#if 0
-static int cb_pcidda_ai_cmdtest(struct comedi_device *dev,
- struct comedi_subdevice *s,
- struct comedi_cmd *cmd)
-{
- int err = 0;
- int tmp;
-
- /* Step 1 : check if triggers are trivially valid */
-
- err |= cfc_check_trigger_src(&cmd->start_src, TRIG_NOW);
- err |= cfc_check_trigger_src(&cmd->scan_begin_src,
- TRIG_TIMER | TRIG_EXT);
- err |= cfc_check_trigger_src(&cmd->convert_src,
- TRIG_TIMER | TRIG_EXT);
- err |= cfc_check_trigger_src(&cmd->scan_end_src, TRIG_COUNT);
- err |= cfc_check_trigger_src(&cmd->stop_src, TRIG_COUNT | TRIG_NONE);
-
- if (err)
- return 1;
-
- /* Step 2a : make sure trigger sources are unique */
-
- err |= cfc_check_trigger_is_unique(cmd->scan_begin_src);
- err |= cfc_check_trigger_is_unique(cmd->convert_src);
- err |= cfc_check_trigger_is_unique(cmd->stop_src);
-
- /* Step 2b : and mutually compatible */
-
- if (err)
- return 2;
-
- /* step 3: make sure arguments are trivially compatible */
-
- if (cmd->start_arg != 0) {
- cmd->start_arg = 0;
- err++;
- }
-#define MAX_SPEED 10000 /* in nanoseconds */
-#define MIN_SPEED 1000000000 /* in nanoseconds */
-
- if (cmd->scan_begin_src == TRIG_TIMER) {
- if (cmd->scan_begin_arg < MAX_SPEED) {
- cmd->scan_begin_arg = MAX_SPEED;
- err++;
- }
- if (cmd->scan_begin_arg > MIN_SPEED) {
- cmd->scan_begin_arg = MIN_SPEED;
- err++;
- }
- } else {
- /* external trigger */
- /* should be level/edge, hi/lo specification here */
- /* should specify multiple external triggers */
- if (cmd->scan_begin_arg > 9) {
- cmd->scan_begin_arg = 9;
- err++;
- }
- }
- if (cmd->convert_src == TRIG_TIMER) {
- if (cmd->convert_arg < MAX_SPEED) {
- cmd->convert_arg = MAX_SPEED;
- err++;
- }
- if (cmd->convert_arg > MIN_SPEED) {
- cmd->convert_arg = MIN_SPEED;
- err++;
- }
- } else {
- /* external trigger */
- /* see above */
- if (cmd->convert_arg > 9) {
- cmd->convert_arg = 9;
- err++;
- }
- }
-
- if (cmd->scan_end_arg != cmd->chanlist_len) {
- cmd->scan_end_arg = cmd->chanlist_len;
- err++;
- }
- if (cmd->stop_src == TRIG_COUNT) {
- if (cmd->stop_arg > 0x00ffffff) {
- cmd->stop_arg = 0x00ffffff;
- err++;
- }
- } else {
- /* TRIG_NONE */
- if (cmd->stop_arg != 0) {
- cmd->stop_arg = 0;
- err++;
- }
- }
-
- if (err)
- return 3;
-
- /* step 4: fix up any arguments */
-
- if (cmd->scan_begin_src == TRIG_TIMER) {
- tmp = cmd->scan_begin_arg;
- cb_pcidda_ns_to_timer(&cmd->scan_begin_arg,
- cmd->flags & TRIG_ROUND_MASK);
- if (tmp != cmd->scan_begin_arg)
- err++;
- }
- if (cmd->convert_src == TRIG_TIMER) {
- tmp = cmd->convert_arg;
- cb_pcidda_ns_to_timer(&cmd->convert_arg,
- cmd->flags & TRIG_ROUND_MASK);
- if (tmp != cmd->convert_arg)
- err++;
- if (cmd->scan_begin_src == TRIG_TIMER &&
- cmd->scan_begin_arg <
- cmd->convert_arg * cmd->scan_end_arg) {
- cmd->scan_begin_arg =
- cmd->convert_arg * cmd->scan_end_arg;
- err++;
- }
- }
-
- if (err)
- return 4;
-
- return 0;
-}
-#endif
-
-/* This function doesn't require a particular form, this is just
- * what happens to be used in some of the drivers. It should
- * convert ns nanoseconds to a counter value suitable for programming
- * the device. Also, it should adjust ns so that it cooresponds to
- * the actual time that the device will use. */
-#if 0
-static int cb_pcidda_ns_to_timer(unsigned int *ns, int round)
-{
- /* trivial timer */
- return *ns;
-}
-#endif
-
/* lowlevel read from eeprom */
static unsigned int cb_pcidda_serial_in(struct comedi_device *dev)
{
s->range_table = thisboard->ranges;
s->insn_write = cb_pcidda_ao_winsn;
- /* s->subdev_flags |= SDF_CMD_READ; */
- /* s->do_cmd = cb_pcidda_ai_cmd; */
- /* s->do_cmdtest = cb_pcidda_ai_cmdtest; */
-
/* two 8255 digital io subdevices */
s = &dev->subdevices[1];
subdev_8255_init(dev, s, NULL, devpriv->digitalio);