Commit f80ac69d authored by Deepak R Varma's avatar Deepak R Varma Committed by Greg Kroah-Hartman

staging: comedi: ni_mio_common: Code reformat and re-indentation

Resolve general code indentation problems as detected by checkpatch script.
Implement code reformat and re-indentation as per coding style to
improve readability.
Signed-off-by: default avatarDeepak R Varma <mh12gx2825@gmail.com>
Link: https://lore.kernel.org/r/20200314210749.GA3393@deeUbuntuSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 073e0be3
...@@ -2199,9 +2199,10 @@ static int ni_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -2199,9 +2199,10 @@ static int ni_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
break; break;
case TRIG_EXT: case TRIG_EXT:
ai_trig |= NISTC_AI_TRIG_START1_SEL( ai_trig |= NISTC_AI_TRIG_START1_SEL(
ni_get_reg_value_roffs(CR_CHAN(cmd->start_arg), ni_get_reg_value_roffs(
NI_AI_StartTrigger, CR_CHAN(cmd->start_arg),
&devpriv->routing_tables, 1)); NI_AI_StartTrigger,
&devpriv->routing_tables, 1));
if (cmd->start_arg & CR_INVERT) if (cmd->start_arg & CR_INVERT)
ai_trig |= NISTC_AI_TRIG_START1_POLARITY; ai_trig |= NISTC_AI_TRIG_START1_POLARITY;
...@@ -2311,10 +2312,12 @@ static int ni_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -2311,10 +2312,12 @@ static int ni_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
(cmd->scan_begin_arg & ~CR_EDGE) != (cmd->scan_begin_arg & ~CR_EDGE) !=
(cmd->convert_arg & ~CR_EDGE)) (cmd->convert_arg & ~CR_EDGE))
start_stop_select |= NISTC_AI_START_SYNC; start_stop_select |= NISTC_AI_START_SYNC;
start_stop_select |= NISTC_AI_START_SEL( start_stop_select |= NISTC_AI_START_SEL(
ni_get_reg_value_roffs(CR_CHAN(cmd->scan_begin_arg), ni_get_reg_value_roffs(
NI_AI_SampleClock, CR_CHAN(cmd->scan_begin_arg),
&devpriv->routing_tables, 1)); NI_AI_SampleClock,
&devpriv->routing_tables, 1));
ni_stc_writew(dev, start_stop_select, NISTC_AI_START_STOP_REG); ni_stc_writew(dev, start_stop_select, NISTC_AI_START_STOP_REG);
break; break;
} }
...@@ -2343,9 +2346,10 @@ static int ni_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -2343,9 +2346,10 @@ static int ni_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
break; break;
case TRIG_EXT: case TRIG_EXT:
mode1 |= NISTC_AI_MODE1_CONVERT_SRC( mode1 |= NISTC_AI_MODE1_CONVERT_SRC(
ni_get_reg_value_roffs(CR_CHAN(cmd->convert_arg), ni_get_reg_value_roffs(
NI_AI_ConvertClock, CR_CHAN(cmd->convert_arg),
&devpriv->routing_tables, 1)); NI_AI_ConvertClock,
&devpriv->routing_tables, 1));
if ((cmd->convert_arg & CR_INVERT) == 0) if ((cmd->convert_arg & CR_INVERT) == 0)
mode1 |= NISTC_AI_MODE1_CONVERT_POLARITY; mode1 |= NISTC_AI_MODE1_CONVERT_POLARITY;
ni_stc_writew(dev, mode1, NISTC_AI_MODE1_REG); ni_stc_writew(dev, mode1, NISTC_AI_MODE1_REG);
...@@ -2970,9 +2974,11 @@ static void ni_ao_cmd_set_trigger(struct comedi_device *dev, ...@@ -2970,9 +2974,11 @@ static void ni_ao_cmd_set_trigger(struct comedi_device *dev,
NISTC_AO_TRIG_START1_SYNC; NISTC_AO_TRIG_START1_SYNC;
} else { /* TRIG_EXT */ } else { /* TRIG_EXT */
trigsel = NISTC_AO_TRIG_START1_SEL( trigsel = NISTC_AO_TRIG_START1_SEL(
ni_get_reg_value_roffs(CR_CHAN(cmd->start_arg), ni_get_reg_value_roffs(
NI_AO_StartTrigger, CR_CHAN(cmd->start_arg),
&devpriv->routing_tables, 1)); NI_AO_StartTrigger,
&devpriv->routing_tables, 1));
/* 0=active high, 1=active low. see daq-stc 3-24 (p186) */ /* 0=active high, 1=active low. see daq-stc 3-24 (p186) */
if (cmd->start_arg & CR_INVERT) if (cmd->start_arg & CR_INVERT)
trigsel |= NISTC_AO_TRIG_START1_POLARITY; trigsel |= NISTC_AO_TRIG_START1_POLARITY;
...@@ -3079,12 +3085,10 @@ static void ni_ao_cmd_set_update(struct comedi_device *dev, ...@@ -3079,12 +3085,10 @@ static void ni_ao_cmd_set_update(struct comedi_device *dev,
* zero out these bit fields to be set below. Does an ao-reset do this * zero out these bit fields to be set below. Does an ao-reset do this
* automatically? * automatically?
*/ */
devpriv->ao_mode1 &= ~( devpriv->ao_mode1 &= ~(NISTC_AO_MODE1_UI_SRC_MASK |
NISTC_AO_MODE1_UI_SRC_MASK | NISTC_AO_MODE1_UI_SRC_POLARITY |
NISTC_AO_MODE1_UI_SRC_POLARITY | NISTC_AO_MODE1_UPDATE_SRC_MASK |
NISTC_AO_MODE1_UPDATE_SRC_MASK | NISTC_AO_MODE1_UPDATE_SRC_POLARITY);
NISTC_AO_MODE1_UPDATE_SRC_POLARITY
);
if (cmd->scan_begin_src == TRIG_TIMER) { if (cmd->scan_begin_src == TRIG_TIMER) {
unsigned int trigvar; unsigned int trigvar;
...@@ -3134,9 +3138,10 @@ static void ni_ao_cmd_set_update(struct comedi_device *dev, ...@@ -3134,9 +3138,10 @@ static void ni_ao_cmd_set_update(struct comedi_device *dev,
/* FIXME: assert scan_begin_arg != 0, ret failure otherwise */ /* FIXME: assert scan_begin_arg != 0, ret failure otherwise */
devpriv->ao_cmd2 |= NISTC_AO_CMD2_BC_GATE_ENA; devpriv->ao_cmd2 |= NISTC_AO_CMD2_BC_GATE_ENA;
devpriv->ao_mode1 |= NISTC_AO_MODE1_UPDATE_SRC( devpriv->ao_mode1 |= NISTC_AO_MODE1_UPDATE_SRC(
ni_get_reg_value(CR_CHAN(cmd->scan_begin_arg), ni_get_reg_value(
NI_AO_SampleClock, CR_CHAN(cmd->scan_begin_arg),
&devpriv->routing_tables)); NI_AO_SampleClock,
&devpriv->routing_tables));
if (cmd->scan_begin_arg & CR_INVERT) if (cmd->scan_begin_arg & CR_INVERT)
devpriv->ao_mode1 |= NISTC_AO_MODE1_UPDATE_SRC_POLARITY; devpriv->ao_mode1 |= NISTC_AO_MODE1_UPDATE_SRC_POLARITY;
} }
...@@ -3673,9 +3678,10 @@ static int ni_cdio_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ...@@ -3673,9 +3678,10 @@ static int ni_cdio_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
cdo_mode_bits = NI_M_CDO_MODE_FIFO_MODE | cdo_mode_bits = NI_M_CDO_MODE_FIFO_MODE |
NI_M_CDO_MODE_HALT_ON_ERROR | NI_M_CDO_MODE_HALT_ON_ERROR |
NI_M_CDO_MODE_SAMPLE_SRC( NI_M_CDO_MODE_SAMPLE_SRC(
ni_get_reg_value(CR_CHAN(cmd->scan_begin_arg), ni_get_reg_value(
NI_DO_SampleClock, CR_CHAN(cmd->scan_begin_arg),
&devpriv->routing_tables)); NI_DO_SampleClock,
&devpriv->routing_tables));
if (cmd->scan_begin_arg & CR_INVERT) if (cmd->scan_begin_arg & CR_INVERT)
cdo_mode_bits |= NI_M_CDO_MODE_POLARITY; cdo_mode_bits |= NI_M_CDO_MODE_POLARITY;
ni_writel(dev, cdo_mode_bits, NI_M_CDO_MODE_REG); ni_writel(dev, cdo_mode_bits, NI_M_CDO_MODE_REG);
......
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