struct ni_private *devpriv = dev->private;
int divider;
- switch (flags & TRIG_ROUND_MASK) {
- case TRIG_ROUND_NEAREST:
+ switch (flags & CMDF_ROUND_MASK) {
+ case CMDF_ROUND_NEAREST:
default:
divider = (nanosec + devpriv->clock_ns / 2) / devpriv->clock_ns;
break;
- case TRIG_ROUND_DOWN:
+ case CMDF_ROUND_DOWN:
divider = (nanosec) / devpriv->clock_ns;
break;
- case TRIG_ROUND_UP:
+ case CMDF_ROUND_UP:
divider = (nanosec + devpriv->clock_ns - 1) / devpriv->clock_ns;
break;
}
/* load SI */
timer = ni_ns_to_timer(dev, cmd->scan_begin_arg,
- TRIG_ROUND_NEAREST);
+ CMDF_ROUND_NEAREST);
ni_stc_writel(dev, timer, AI_SI_Load_A_Registers);
ni_stc_writew(dev, AI_SI_Load, AI_Command_1_Register);
break;
timer = 1;
else
timer = ni_ns_to_timer(dev, cmd->convert_arg,
- TRIG_ROUND_NEAREST);
+ CMDF_ROUND_NEAREST);
/* 0,0 does not work */
ni_stc_writew(dev, 1, AI_SI2_Load_A_Register);
ni_stc_writew(dev, timer, AI_SI2_Load_B_Register);
devpriv->ao_cmd2 &= ~AO_BC_Gate_Enable;
trigvar =
ni_ns_to_timer(dev, cmd->scan_begin_arg,
- TRIG_ROUND_NEAREST);
+ CMDF_ROUND_NEAREST);
ni_stc_writel(dev, 1, AO_UI_Load_A_Register);
ni_stc_writew(dev, AO_UI_Load, AO_Command_1_Register);
ni_stc_writel(dev, trigvar, AO_UI_Load_A_Register);
switch (data[0]) {
case INSN_CONFIG_PWM_OUTPUT:
switch (data[1]) {
- case TRIG_ROUND_NEAREST:
+ case CMDF_ROUND_NEAREST:
up_count =
(data[2] +
devpriv->clock_ns / 2) / devpriv->clock_ns;
break;
- case TRIG_ROUND_DOWN:
+ case CMDF_ROUND_DOWN:
up_count = data[2] / devpriv->clock_ns;
break;
- case TRIG_ROUND_UP:
+ case CMDF_ROUND_UP:
up_count =
(data[2] + devpriv->clock_ns -
1) / devpriv->clock_ns;
return -EINVAL;
}
switch (data[3]) {
- case TRIG_ROUND_NEAREST:
+ case CMDF_ROUND_NEAREST:
down_count =
(data[4] +
devpriv->clock_ns / 2) / devpriv->clock_ns;
break;
- case TRIG_ROUND_DOWN:
+ case CMDF_ROUND_DOWN:
down_count = data[4] / devpriv->clock_ns;
break;
- case TRIG_ROUND_UP:
+ case CMDF_ROUND_UP:
down_count =
(data[4] + devpriv->clock_ns -
1) / devpriv->clock_ns;
switch (data[0]) {
case INSN_CONFIG_PWM_OUTPUT:
switch (data[1]) {
- case TRIG_ROUND_NEAREST:
+ case CMDF_ROUND_NEAREST:
up_count =
(data[2] +
devpriv->clock_ns / 2) / devpriv->clock_ns;
break;
- case TRIG_ROUND_DOWN:
+ case CMDF_ROUND_DOWN:
up_count = data[2] / devpriv->clock_ns;
break;
- case TRIG_ROUND_UP:
+ case CMDF_ROUND_UP:
up_count =
(data[2] + devpriv->clock_ns -
1) / devpriv->clock_ns;
return -EINVAL;
}
switch (data[3]) {
- case TRIG_ROUND_NEAREST:
+ case CMDF_ROUND_NEAREST:
down_count =
(data[4] +
devpriv->clock_ns / 2) / devpriv->clock_ns;
break;
- case TRIG_ROUND_DOWN:
+ case CMDF_ROUND_DOWN:
down_count = data[4] / devpriv->clock_ns;
break;
- case TRIG_ROUND_UP:
+ case CMDF_ROUND_UP:
down_count =
(data[4] + devpriv->clock_ns -
1) / devpriv->clock_ns;