On 12/11/14 23:00, H Hartley Sweeten wrote:
Currently the async command support in this driver consists of just the
stubbed in functions.

Flesh out the (*do_cmdtest) function for basic support of timed analog
input acquisitions.

Signed-off-by: H Hartley Sweeten <hswee...@visionengravers.com>
Cc: Ian Abbott <abbo...@mev.co.uk>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
  drivers/staging/comedi/drivers/das6402.c | 105 ++++++++++++++++++++++++++++++-
  1 file changed, 104 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/das6402.c 
b/drivers/staging/comedi/drivers/das6402.c
index f3909f3..511b6b3 100644
--- a/drivers/staging/comedi/drivers/das6402.c
+++ b/drivers/staging/comedi/drivers/das6402.c
@@ -35,6 +35,7 @@
  #include <linux/interrupt.h>

  #include "../comedidev.h"
+#include "comedi_fc.h"
  #include "8253.h"

  /*
@@ -207,11 +208,113 @@ static int das6402_ai_cmd(struct comedi_device *dev,
        return -EINVAL;
  }

+static int das6402_ai_check_chanlist(struct comedi_device *dev,
+                                    struct comedi_subdevice *s,
+                                    struct comedi_cmd *cmd)
+{
+       unsigned int chan0 = CR_CHAN(cmd->chanlist[0]);
+       unsigned int range0 = CR_RANGE(cmd->chanlist[0]);
+       unsigned int aref0 = CR_AREF(cmd->chanlist[0]);
+       int i;
+
+       for (i = 1; i < cmd->chanlist_len; i++) {
+               unsigned int chan = CR_CHAN(cmd->chanlist[i]);
+               unsigned int range = CR_RANGE(cmd->chanlist[i]);
+               unsigned int aref = CR_AREF(cmd->chanlist[i]);
+
+               if (chan != chan0 + i) {
+                       dev_dbg(dev->class_dev,
+                               "chanlist must be consecutive\n");
+                       return -EINVAL;
+               }
+
+               if (range != range0) {
+                       dev_dbg(dev->class_dev,
+                               "chanlist must have the same range\n");
+                       return -EINVAL;
+               }
+
+               if (aref != aref0) {
+                       dev_dbg(dev->class_dev,
+                               "chanlist must have the reference\n");

Shouldn't that say the _same_ reference?

--
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbo...@mev.co.uk> )=-
-=(                          Web: http://www.mev.co.uk/  )=-
_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to