Re: [PATCH 3/3] staging: comedi: ni_mio_comon: add finite regeneration to dio output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/01/16 08:17, Spencer E. Olson wrote:
This patch continues the implementation of reinterpreting stop_arg when
stop_src == TRIG_NONE for national instruments cdio output on e/m-series
devices.  This is part of a series of patches that allow a user to have a
specific buffer repeated as-is indefinitely.  The contents of the DMA
buffer can be left static or changed by the user via mmap access to the DMA
buffer.  If the contents are changed by the user, additional munging is not
performed by the driver and only a single call to
comedi_mark_buffer_written should be done.  The original behavior is
preserved when stop_arg == 0, as would be the prior use case.

As opposed to analog output, this patch is relatively simple.  First, the
digital output capabilities are much more limited/simple as compared to the
analog output device on NI e/m-series hardware, and second, this patch
relies on changes made with the earlier patch to accomplish limiting the
DMA buffer transfer.

Signed-off-by: Spencer E. Olson <olsonse@xxxxxxxxx>
---
  drivers/staging/comedi/drivers/ni_mio_common.c | 9 ++++++++-
  1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c
index 8941351..2f79c14 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -3605,7 +3605,9 @@ static int ni_cdio_cmdtest(struct comedi_device *dev,
  	err |= comedi_check_trigger_arg_is(&cmd->convert_arg, 0);
  	err |= comedi_check_trigger_arg_is(&cmd->scan_end_arg,
  					   cmd->chanlist_len);
-	err |= comedi_check_trigger_arg_is(&cmd->stop_arg, 0);
+	err |= comedi_check_trigger_arg_max(&cmd->stop_arg,
+					    s->async->prealloc_bufsz /
+					    comedi_bytes_per_scan(s));

  	if (err)
  		return 3;
@@ -3682,6 +3684,7 @@ static int ni_cdo_inttrig(struct comedi_device *dev,

  static int ni_cdio_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
  {
+	struct ni_private *devpriv = dev->private;
  	const struct comedi_cmd *cmd = &s->async->cmd;
  	unsigned cdo_mode_bits;
  	int retval;
@@ -3706,6 +3709,10 @@ static int ni_cdio_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
  	if (retval < 0)
  		return retval;

+	ni_cmd_set_mite_transfer(devpriv->cdo_mite_ring, s, cmd,
+				 s->async->prealloc_bufsz /
+				 comedi_bytes_per_scan(s));
+
  	s->async->inttrig = ni_cdo_inttrig;

  	return 0;


Looks good.

Reviewed-by: Ian Abbott <abbotti@xxxxxxxxx>

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



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux