Commit 12e1e696 authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman

staging: comedi: usbduxsigma: remove AI scan_begin_src == TRIG_FOLLOW

The AI subdevice `cmdtest` handler `usbduxsigma_ai_cmdtest()` ensures
that `cmd->scan_begin_src == TRIG_TIMER` by the end of step 2 of the
command checking code, so assume that this is the case for step 3
onwards and remove the redundant code.
Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Reviewed-by: default avatarBernd Porr <mail@berndporr.me.uk>
Reviewed-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c04a1f17
...@@ -482,6 +482,7 @@ static int usbduxsigma_ai_cmdtest(struct comedi_device *dev, ...@@ -482,6 +482,7 @@ static int usbduxsigma_ai_cmdtest(struct comedi_device *dev,
struct usbduxsigma_private *devpriv = dev->private; struct usbduxsigma_private *devpriv = dev->private;
int high_speed = devpriv->high_speed; int high_speed = devpriv->high_speed;
int interval = usbduxsigma_chans_to_interval(cmd->chanlist_len); int interval = usbduxsigma_chans_to_interval(cmd->chanlist_len);
unsigned int tmp;
int err = 0; int err = 0;
/* Step 1 : check if triggers are trivially valid */ /* Step 1 : check if triggers are trivially valid */
...@@ -509,36 +510,26 @@ static int usbduxsigma_ai_cmdtest(struct comedi_device *dev, ...@@ -509,36 +510,26 @@ static int usbduxsigma_ai_cmdtest(struct comedi_device *dev,
err |= comedi_check_trigger_arg_is(&cmd->start_arg, 0); err |= comedi_check_trigger_arg_is(&cmd->start_arg, 0);
if (cmd->scan_begin_src == TRIG_FOLLOW) /* internal trigger */ if (high_speed) {
err |= comedi_check_trigger_arg_is(&cmd->scan_begin_arg, 0); /*
* In high speed mode microframes are possible.
* However, during one microframe we can roughly
* sample two channels. Thus, the more channels
* are in the channel list the more time we need.
*/
err |= comedi_check_trigger_arg_min(&cmd->scan_begin_arg,
(125000 * interval));
if (cmd->scan_begin_src == TRIG_TIMER) { tmp = (cmd->scan_begin_arg / 125000) * 125000;
unsigned int tmp; } else {
/* full speed */
if (high_speed) { /* 1kHz scans every USB frame */
/* err |= comedi_check_trigger_arg_min(&cmd->scan_begin_arg,
* In high speed mode microframes are possible. 1000000);
* However, during one microframe we can roughly
* sample two channels. Thus, the more channels tmp = (cmd->scan_begin_arg / 1000000) * 1000000;
* are in the channel list the more time we need.
*/
err |= comedi_check_trigger_arg_min(&cmd->
scan_begin_arg,
(1000000 / 8 *
interval));
tmp = (cmd->scan_begin_arg / 125000) * 125000;
} else {
/* full speed */
/* 1kHz scans every USB frame */
err |= comedi_check_trigger_arg_min(&cmd->
scan_begin_arg,
1000000);
tmp = (cmd->scan_begin_arg / 1000000) * 1000000;
}
err |= comedi_check_trigger_arg_is(&cmd->scan_begin_arg, tmp);
} }
err |= comedi_check_trigger_arg_is(&cmd->scan_begin_arg, tmp);
err |= comedi_check_trigger_arg_is(&cmd->scan_end_arg, err |= comedi_check_trigger_arg_is(&cmd->scan_end_arg,
cmd->chanlist_len); cmd->chanlist_len);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment