summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/usbduxfast.c
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2015-08-24 10:14:03 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-09-12 18:24:25 -0700
commita05e94bd5230a90eca2905495e764a0ad707c498 (patch)
tree398b5d9a474c1af1882f5115504284f45a28ddd5 /drivers/staging/comedi/drivers/usbduxfast.c
parent7b0fc5baa0bd75fa04cd784828d7d072fb905144 (diff)
staging: comedi: usbduxfast: document strange ai maxdata
The subdevice 'maxdata' is typically a mask of the valid bits that can be returned by a subdevice, (1 << bits) - 1. The analog inputs of this device have a resolution of 12-bits so the 'maxdata' should be 0x0fff. But, this hardware can produce a value of 0x1000 indicating an overflow from the ADC. The comedilib library's comedi_to_phys() function will then return NAN when this value is read from the hardware. Add a comment to clarify the strage 'maxdata' value. 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/usbduxfast.c')
-rw-r--r--drivers/staging/comedi/drivers/usbduxfast.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/comedi/drivers/usbduxfast.c b/drivers/staging/comedi/drivers/usbduxfast.c
index 60f1c5e15a6a..9e846b43f54e 100644
--- a/drivers/staging/comedi/drivers/usbduxfast.c
+++ b/drivers/staging/comedi/drivers/usbduxfast.c
@@ -865,7 +865,7 @@ static int usbduxfast_attach_common(struct comedi_device *dev)
s->do_cmdtest = usbduxfast_ai_cmdtest;
s->do_cmd = usbduxfast_ai_cmd;
s->cancel = usbduxfast_ai_cancel;
- s->maxdata = 0x1000;
+ s->maxdata = 0x1000; /* 12-bit + 1 overflow bit */
s->range_table = &range_usbduxfast_ai_range;
up(&devpriv->sem);