[PATCH] staging: comedi: ni_mio_common: scale ao INSN_CONFIG_GET_CMD_TIMING_CONSTRAINTS

Spencer E. Olson olsonse at umich.edu
Wed Oct 24 13:59:45 UTC 2018


Changes implementation of INSN_CONFIG_GET_CMD_TIMING_CONSTRAINTS for
ni_mio devices to scale the result by the number of channels being used.
The user is already required to indicate which channels (and how many
obviously) are intended to be used.  There is no point of not using this
information--the analog input cards already similarly scale the timing
results based on the number of channels.

Signed-off-by: Spencer E. Olson <olsonse at umich.edu>
---
 This patch is made in reference to the last set of patches adding the timing
 constraint facility in pci_mio_common
 (51fd3673838396844f15de0e906be5333bfbbc8d).

 drivers/staging/comedi/drivers/ni_mio_common.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c
index 2d1e0325d04d..5edf59ac6706 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -2843,7 +2843,8 @@ static int ni_ao_insn_config(struct comedi_device *dev,
 		return ni_ao_arm(dev, s);
 	case INSN_CONFIG_GET_CMD_TIMING_CONSTRAINTS:
 		/* we don't care about actual channels */
-		data[1] = board->ao_speed;
+		/* data[3] : chanlist_len */
+		data[1] = board->ao_speed * data[3];
 		data[2] = 0;
 		return 0;
 	default:
-- 
2.17.1



More information about the devel mailing list