Commit 19ce5d61 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

staging: comedi: cb_pcidas: tidy up calibration trimpot subdevice

For aesthetics, add some whitespace to the subdevice init.

It's not possible to actually read from the trimpot. For convienence
the subdevice readback provided by the core is used to return the
last value written to the subdevice. Remove the SDF_READABLE flag
from the subdev_flags.

Move the comment about the channels from trimpot_8402_write() to
the subdevice init and fix the checkpatch.pl issue about:

WARNING: Block comments use a trailing */ on a separate line
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 53cb50aa
...@@ -647,9 +647,6 @@ static int trimpot_7376_write(struct comedi_device *dev, u8 value) ...@@ -647,9 +647,6 @@ static int trimpot_7376_write(struct comedi_device *dev, u8 value)
return 0; return 0;
} }
/* For 1602/16 only
* ch 0 : adc gain
* ch 1 : adc postgain offset */
static int trimpot_8402_write(struct comedi_device *dev, unsigned int channel, static int trimpot_8402_write(struct comedi_device *dev, unsigned int channel,
u8 value) u8 value)
{ {
...@@ -1442,14 +1439,19 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev, ...@@ -1442,14 +1439,19 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev,
s->readback[i] = s->maxdata / 2; s->readback[i] = s->maxdata / 2;
} }
/* trim potentiometer */ /* Calibration subdevice - trim potentiometer */
s = &dev->subdevices[5]; s = &dev->subdevices[5];
s->type = COMEDI_SUBD_CALIB; s->type = COMEDI_SUBD_CALIB;
s->subdev_flags = SDF_READABLE | SDF_WRITABLE | SDF_INTERNAL; s->subdev_flags = SDF_WRITABLE | SDF_INTERNAL;
if (board->trimpot == AD7376) { if (board->trimpot == AD7376) {
s->n_chan = 1; s->n_chan = 1;
s->maxdata = 0x7f; s->maxdata = 0x7f;
} else { } else { /* AD8402 */
/*
* For pci-das1602/16:
* chan 0 : adc gain
* chan 1 : adc postgain offset
*/
s->n_chan = 2; s->n_chan = 2;
s->maxdata = 0xff; s->maxdata = 0xff;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment