提交 e0c6fe12 编写于 作者: I Ian Abbott 提交者: Greg Kroah-Hartman

staging: comedi: comedi_test: allow read-back of AO channels

COMEDI drivers often allow the last value written to a channel on an
analog output subdevice to be read back via the "insn_read" handler.
The "comedi_test" driver does not currently support that.  It is a bit
special because it loops back the last values written to the channel on
the analog output subdevice to be read back via corresponding channels
on the analog input subdevice.  The "insn_read" handler for the analog
input subdevice is `waveform_ai_insn_read()`.  Set that as the
"insn_read" handler for the analog output subdevice as well.
Signed-off-by: NIan Abbott <abbotti@mev.co.uk>
Reviewed-by: NH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 3b2468fe
...@@ -457,6 +457,7 @@ static int waveform_attach(struct comedi_device *dev, ...@@ -457,6 +457,7 @@ static int waveform_attach(struct comedi_device *dev,
s->maxdata = 0xffff; s->maxdata = 0xffff;
s->range_table = &waveform_ai_ranges; s->range_table = &waveform_ai_ranges;
s->insn_write = waveform_ao_insn_write; s->insn_write = waveform_ao_insn_write;
s->insn_read = waveform_ai_insn_read; /* do same as AI insn_read */
/* Our default loopback value is just a 0V flatline */ /* Our default loopback value is just a 0V flatline */
for (i = 0; i < s->n_chan; i++) for (i = 0; i < s->n_chan; i++)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册