aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/comedi/drivers/cb_pcidas.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2015-10-13 17:47:45 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-16 23:20:10 -0700
commit19ce5d61528a464d97f7cfa17f01bcdc86ded8ae (patch)
tree9f0805dcab3722f84a4f134adb2c450afc606989 /drivers/staging/comedi/drivers/cb_pcidas.c
parentstaging: comedi: cb_pcidas: use preferred kernel types (diff)
downloadlinux-dev-19ce5d61528a464d97f7cfa17f01bcdc86ded8ae.tar.xz
linux-dev-19ce5d61528a464d97f7cfa17f01bcdc86ded8ae.zip
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: H Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/comedi/drivers/cb_pcidas.c')
-rw-r--r--drivers/staging/comedi/drivers/cb_pcidas.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/staging/comedi/drivers/cb_pcidas.c b/drivers/staging/comedi/drivers/cb_pcidas.c
index 2df80f6631f1..99a95c2ccaa9 100644
--- a/drivers/staging/comedi/drivers/cb_pcidas.c
+++ b/drivers/staging/comedi/drivers/cb_pcidas.c
@@ -647,9 +647,6 @@ static int trimpot_7376_write(struct comedi_device *dev, u8 value)
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,
u8 value)
{
@@ -1442,18 +1439,23 @@ static int cb_pcidas_auto_attach(struct comedi_device *dev,
s->readback[i] = s->maxdata / 2;
}
- /* trim potentiometer */
+ /* Calibration subdevice - trim potentiometer */
s = &dev->subdevices[5];
- s->type = COMEDI_SUBD_CALIB;
- s->subdev_flags = SDF_READABLE | SDF_WRITABLE | SDF_INTERNAL;
+ s->type = COMEDI_SUBD_CALIB;
+ s->subdev_flags = SDF_WRITABLE | SDF_INTERNAL;
if (board->trimpot == AD7376) {
- s->n_chan = 1;
- s->maxdata = 0x7f;
- } else {
- s->n_chan = 2;
- s->maxdata = 0xff;
+ s->n_chan = 1;
+ s->maxdata = 0x7f;
+ } else { /* AD8402 */
+ /*
+ * For pci-das1602/16:
+ * chan 0 : adc gain
+ * chan 1 : adc postgain offset
+ */
+ s->n_chan = 2;
+ s->maxdata = 0xff;
}
- s->insn_write = cb_pcidas_trimpot_insn_write;
+ s->insn_write = cb_pcidas_trimpot_insn_write;
ret = comedi_alloc_subdev_readback(s);
if (ret)