summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2013-06-12 16:22:33 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-06-17 14:33:56 -0700
commit66573991c47f3e826f294b6ab4aa1cf967d5f426 (patch)
treea6f3cc06e770ae6451935b38b8df261a5e74d0c1 /drivers
parent308380e69625c347f88ba23da9dc0e9a58918838 (diff)
staging: comedi: addi_apci_3xxx: stub in analog input command support
The analog input subdevice in this driver is broken. The attach of this driver requests the irq and sets the dev->read_subdev to the analog input subdevice but it does not setup the subdevice to support commands. Stub in the command support functions so we can fix the subdevice. 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')
-rw-r--r--drivers/staging/comedi/drivers/addi_apci_3xxx.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/drivers/staging/comedi/drivers/addi_apci_3xxx.c b/drivers/staging/comedi/drivers/addi_apci_3xxx.c
index dbb35c7b45a0..77f0c455c19d 100644
--- a/drivers/staging/comedi/drivers/addi_apci_3xxx.c
+++ b/drivers/staging/comedi/drivers/addi_apci_3xxx.c
@@ -392,6 +392,25 @@ static irqreturn_t apci3xxx_irq_handler(int irq, void *d)
return IRQ_RETVAL(1);
}
+static int apci3xxx_ai_cmdtest(struct comedi_device *dev,
+ struct comedi_subdevice *s,
+ struct comedi_cmd *cmd)
+{
+ return 0;
+}
+
+static int apci3xxx_ai_cmd(struct comedi_device *dev,
+ struct comedi_subdevice *s)
+{
+ return 0;
+}
+
+static int apci3xxx_ai_cancel(struct comedi_device *dev,
+ struct comedi_subdevice *s)
+{
+ return 0;
+}
+
static int apci3xxx_ao_insn_write(struct comedi_device *dev,
struct comedi_subdevice *s,
struct comedi_insn *insn,
@@ -600,7 +619,6 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
/* Analog Input subdevice */
s = &dev->subdevices[0];
if (board->ai_n_chan) {
- dev->read_subdev = s;
s->type = COMEDI_SUBD_AI;
s->subdev_flags = SDF_READABLE | board->ai_subdev_flags;
s->n_chan = board->ai_n_chan;
@@ -609,7 +627,13 @@ static int apci3xxx_auto_attach(struct comedi_device *dev,
s->range_table = &apci3xxx_ai_range;
s->insn_config = apci3xxx_ai_insn_config;
s->insn_read = apci3xxx_ai_insn_read;
-
+ if (dev->irq) {
+ dev->read_subdev = s;
+ s->subdev_flags |= SDF_CMD_READ;
+ s->do_cmdtest = apci3xxx_ai_cmdtest;
+ s->do_cmd = apci3xxx_ai_cmd;
+ s->cancel = apci3xxx_ai_cancel;
+ }
} else {
s->type = COMEDI_SUBD_UNUSED;
}