Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317707
b: refs/heads/master
c: 2792182
h: refs/heads/master
i:
  317705: 8588451
  317703: a8869cf
v: v3
  • Loading branch information
H Hartley Sweeten authored and Greg Kroah-Hartman committed Jul 6, 2012
1 parent d582d3a commit 85a7bb1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 49 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 29f747c21e4318cc41efa82dac217da9ee8d5533
refs/heads/master: 2792182816be376391c2cfc142bfd32f3ab8c5cd
71 changes: 23 additions & 48 deletions trunk/drivers/staging/comedi/drivers/dmm32at.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,21 +156,8 @@ static const struct comedi_lrange dmm32at_aoranges = {
}
};

/*
* Board descriptions for two imaginary boards. Describing the
* boards in this way is optional, and completely driver-dependent.
* Some drivers use arrays such as this, other do not.
*/
struct dmm32at_board {
const char *name;
int ai_chans;
int ai_bits;
const struct comedi_lrange *ai_ranges;
int ao_chans;
int ao_bits;
const struct comedi_lrange *ao_ranges;
int have_dio;
int dio_chans;
};

/* this structure is for data unique to this hardware driver. If
Expand Down Expand Up @@ -880,9 +867,9 @@ static int dmm32at_attach(struct comedi_device *dev,
s->type = COMEDI_SUBD_AI;
/* we support single-ended (ground) and differential */
s->subdev_flags = SDF_READABLE | SDF_GROUND | SDF_DIFF | SDF_CMD_READ;
s->n_chan = board->ai_chans;
s->maxdata = (1 << board->ai_bits) - 1;
s->range_table = board->ai_ranges;
s->n_chan = 32;
s->maxdata = 0xffff;
s->range_table = &dmm32at_airanges;
s->len_chanlist = 32; /* This is the maximum chanlist length that
the board can handle */
s->insn_read = dmm32at_ai_rinsn;
Expand All @@ -894,35 +881,31 @@ static int dmm32at_attach(struct comedi_device *dev,
/* analog output subdevice */
s->type = COMEDI_SUBD_AO;
s->subdev_flags = SDF_WRITABLE;
s->n_chan = board->ao_chans;
s->maxdata = (1 << board->ao_bits) - 1;
s->range_table = board->ao_ranges;
s->n_chan = 4;
s->maxdata = 0x0fff;
s->range_table = &dmm32at_aoranges;
s->insn_write = dmm32at_ao_winsn;
s->insn_read = dmm32at_ao_rinsn;

s = dev->subdevices + 2;
/* digital i/o subdevice */
if (board->have_dio) {

/* get access to the DIO regs */
outb(DMM32AT_DIOACC, dev->iobase + DMM32AT_CNTRL);
/* set the DIO's to the defualt input setting */
devpriv->dio_config = DMM32AT_DIRA | DMM32AT_DIRB |
DMM32AT_DIRCL | DMM32AT_DIRCH | DMM32AT_DIENABLE;
outb(devpriv->dio_config, dev->iobase + DMM32AT_DIOCONF);

/* set up the subdevice */
s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
s->n_chan = board->dio_chans;
s->maxdata = 1;
s->state = 0;
s->range_table = &range_digital;
s->insn_bits = dmm32at_dio_insn_bits;
s->insn_config = dmm32at_dio_insn_config;
} else {
s->type = COMEDI_SUBD_UNUSED;
}

/* get access to the DIO regs */
outb(DMM32AT_DIOACC, dev->iobase + DMM32AT_CNTRL);
/* set the DIO's to the defualt input setting */
devpriv->dio_config = DMM32AT_DIRA | DMM32AT_DIRB |
DMM32AT_DIRCL | DMM32AT_DIRCH | DMM32AT_DIENABLE;
outb(devpriv->dio_config, dev->iobase + DMM32AT_DIOCONF);

/* set up the subdevice */
s->type = COMEDI_SUBD_DIO;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE;
s->n_chan = 24;
s->maxdata = 1;
s->state = 0;
s->range_table = &range_digital;
s->insn_bits = dmm32at_dio_insn_bits;
s->insn_config = dmm32at_dio_insn_config;

/* success */
printk(KERN_INFO "comedi%d: dmm32at: attached\n", dev->minor);
Expand All @@ -942,14 +925,6 @@ static void dmm32at_detach(struct comedi_device *dev)
static const struct dmm32at_board dmm32at_boards[] = {
{
.name = "dmm32at",
.ai_chans = 32,
.ai_bits = 16,
.ai_ranges = &dmm32at_airanges,
.ao_chans = 4,
.ao_bits = 12,
.ao_ranges = &dmm32at_aoranges,
.have_dio = 1,
.dio_chans = 24,
},
};

Expand Down

0 comments on commit 85a7bb1

Please sign in to comment.