staging: comedi: dt2811: tidy up analog input subdevice init
Add some whitespace to the analog output subdevice initialization and rename the (*insn_read) function. Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
048e27aac9
commit
f52e8d0cae
1 changed files with 10 additions and 8 deletions
|
@ -197,8 +197,10 @@ static int dt2811_ai_eoc(struct comedi_device *dev,
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dt2811_ai_insn(struct comedi_device *dev, struct comedi_subdevice *s,
|
static int dt2811_ai_insn_read(struct comedi_device *dev,
|
||||||
struct comedi_insn *insn, unsigned int *data)
|
struct comedi_subdevice *s,
|
||||||
|
struct comedi_insn *insn,
|
||||||
|
unsigned int *data)
|
||||||
{
|
{
|
||||||
unsigned int chan = CR_CHAN(insn->chanspec);
|
unsigned int chan = CR_CHAN(insn->chanspec);
|
||||||
unsigned int range = CR_RANGE(insn->chanspec);
|
unsigned int range = CR_RANGE(insn->chanspec);
|
||||||
|
@ -283,17 +285,17 @@ static int dt2811_attach(struct comedi_device *dev, struct comedi_devconfig *it)
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
/* Analog Input subdevice */
|
||||||
s = &dev->subdevices[0];
|
s = &dev->subdevices[0];
|
||||||
/* initialize the ADC subdevice */
|
s->type = COMEDI_SUBD_AI;
|
||||||
s->type = COMEDI_SUBD_AI;
|
s->subdev_flags = SDF_READABLE |
|
||||||
s->subdev_flags = SDF_READABLE |
|
|
||||||
(it->options[2] == 1) ? SDF_DIFF :
|
(it->options[2] == 1) ? SDF_DIFF :
|
||||||
(it->options[2] == 2) ? SDF_COMMON : SDF_GROUND;
|
(it->options[2] == 2) ? SDF_COMMON : SDF_GROUND;
|
||||||
s->n_chan = (it->options[2] == 1) ? 8 : 16;
|
s->n_chan = (it->options[2] == 1) ? 8 : 16;
|
||||||
s->insn_read = dt2811_ai_insn;
|
s->maxdata = 0x0fff;
|
||||||
s->maxdata = 0xfff;
|
|
||||||
s->range_table = board->is_pgh ? &dt2811_pgh_ai_ranges
|
s->range_table = board->is_pgh ? &dt2811_pgh_ai_ranges
|
||||||
: &dt2811_pgl_ai_ranges;
|
: &dt2811_pgl_ai_ranges;
|
||||||
|
s->insn_read = dt2811_ai_insn_read;
|
||||||
|
|
||||||
/* Analog Output subdevice */
|
/* Analog Output subdevice */
|
||||||
s = &dev->subdevices[1];
|
s = &dev->subdevices[1];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue