diff options
author | H Hartley Sweeten <hsweeten@visionengravers.com> | 2014-11-04 10:55:14 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-11-07 09:34:04 -0800 |
commit | 15cf0617c0186c24f8d6ff7fcf2bf505878f351e (patch) | |
tree | b9ba326ad535a43c89be455263d97e5eb6a38938 /drivers/staging/comedi/drivers/addi_apci_3120.c | |
parent | staging: comedi: addi_apci_3120: define the AI software trigger register (diff) | |
download | linux-dev-15cf0617c0186c24f8d6ff7fcf2bf505878f351e.tar.xz linux-dev-15cf0617c0186c24f8d6ff7fcf2bf505878f351e.zip |
staging: comedi: addi_apci_3120: fix timer (*insn_read)
The timer subdevice in this driver does not follow the comedi API.
Fix the (*insn_read) to work correctly.
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/addi_apci_3120.c')
-rw-r--r-- | drivers/staging/comedi/drivers/addi_apci_3120.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/staging/comedi/drivers/addi_apci_3120.c b/drivers/staging/comedi/drivers/addi_apci_3120.c index ec2077cb68f0..c67c10fc7d66 100644 --- a/drivers/staging/comedi/drivers/addi_apci_3120.c +++ b/drivers/staging/comedi/drivers/addi_apci_3120.c @@ -447,6 +447,19 @@ static int apci3120_do_insn_bits(struct comedi_device *dev, return insn->n; } +static int apci3120_timer_insn_read(struct comedi_device *dev, + struct comedi_subdevice *s, + struct comedi_insn *insn, + unsigned int *data) +{ + int i; + + for (i = 0; i < insn->n; i++) + data[i] = apci3120_timer_read(dev, 2); + + return insn->n; +} + static void apci3120_dma_alloc(struct comedi_device *dev) { struct apci3120_private *devpriv = dev->private; @@ -618,8 +631,8 @@ static int apci3120_auto_attach(struct comedi_device *dev, s->n_chan = 1; s->maxdata = 0x00ffffff; s->insn_write = apci3120_write_insn_timer; - s->insn_read = apci3120_read_insn_timer; s->insn_config = apci3120_config_insn_timer; + s->insn_read = apci3120_timer_insn_read; return 0; } |