]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: comedi: ni_stc.h: tidy up Analog_Trigger_Etc_Register and bits
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 1 May 2015 21:59:17 +0000 (14:59 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 May 2015 17:05:11 +0000 (19:05 +0200)
Rename the CamelCase. Use the BIT() macro to define the bits.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: Ian Abbott <abbotti@mev.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/comedi/drivers/ni_mio_common.c
drivers/staging/comedi/drivers/ni_stc.h

index 20557b5be9969a4bbfaa2a3aea7df4c839524265..265f9baffe18b19f2910b1462ed8c22b713b1ff8 100644 (file)
@@ -356,7 +356,7 @@ static const struct mio_regmap m_series_stc_write_regmap[] = {
        [NISTC_RTSI_TRIG_DIR_REG]       = { 0x174, 2 },
        [NISTC_INT_CTRL_REG]            = { 0x176, 2 },
        [NISTC_AI_OUT_CTRL_REG]         = { 0x178, 2 },
-       [Analog_Trigger_Etc_Register]   = { 0x17a, 2 },
+       [NISTC_ATRIG_ETC_REG]           = { 0x17a, 2 },
        [AI_START_STOP_Select_Register] = { 0x17c, 2 },
        [AI_Trigger_Select_Register]    = { 0x17e, 2 },
        [AI_DIV_Load_A_Register]        = { 0x180, 4 },
@@ -2262,9 +2262,8 @@ static int ni_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s)
 
        /* disable analog triggering for now, since it
         * interferes with the use of pfi0 */
-       devpriv->an_trig_etc_reg &= ~Analog_Trigger_Enable;
-       ni_stc_writew(dev, devpriv->an_trig_etc_reg,
-                     Analog_Trigger_Etc_Register);
+       devpriv->an_trig_etc_reg &= ~NISTC_ATRIG_ETC_ENA;
+       ni_stc_writew(dev, devpriv->an_trig_etc_reg, NISTC_ATRIG_ETC_REG);
 
        switch (cmd->start_src) {
        case TRIG_INT:
index 69156afa3098142775db25d96bbecffb91d852ce..2b290063bce4872890fe64a4300760d0548f4c44 100644 (file)
 #define NISTC_AI_OUT_CTRL_CONVERT_LOW          NISTC_AI_OUT_CTRL_CONVERT_SEL(2)
 #define NISTC_AI_OUT_CTRL_CONVERT_HIGH         NISTC_AI_OUT_CTRL_CONVERT_SEL(3)
 
+#define NISTC_ATRIG_ETC_REG            61
+#define NISTC_ATRIG_ETC_GPFO_1_ENA     BIT(15)
+#define NISTC_ATRIG_ETC_GPFO_0_ENA     BIT(14)
+#define NISTC_ATRIG_ETC_GPFO_0_SEL(x)  (((x) & 0x3) << 11)
+#define NISTC_ATRIG_ETC_GPFO_1_SEL     BIT(7)
+#define NISTC_ATRIG_ETC_DRV            BIT(4)
+#define NISTC_ATRIG_ETC_ENA            BIT(3)
+#define NISTC_ATRIG_ETC_MODE(x)                (((x) & 0x7) << 0)
+
 #define AI_Status_1_Register           2
 #define Interrupt_A_St                         0x8000
 #define AI_FIFO_Full_St                                0x4000
@@ -587,7 +596,6 @@ static unsigned AO_UPDATE_Output_Select(enum ao_update_output_selection
 #define G_Save_Register_High(a)                (12+(a)*2)
 #define G_Save_Register_Low(a)         (13+(a)*2)
 #define G_Status_Register              4
-#define Analog_Trigger_Etc_Register    61
 
 /* command register */
 #define G_Disarm_Copy                  _bit15  /* strobe */
@@ -657,15 +665,6 @@ static unsigned AO_UPDATE_Output_Select(enum ao_update_output_selection
 /* general purpose counter timer */
 #define G_Autoincrement(a)              ((a)<<0)
 
-/*Analog_Trigger_Etc_Register*/
-#define Analog_Trigger_Mode(x) ((x) & 0x7)
-#define Analog_Trigger_Enable _bit3
-#define Analog_Trigger_Drive _bit4
-#define GPFO_1_Output_Select           _bit7
-#define GPFO_0_Output_Select(a)                ((a)<<11)
-#define GPFO_0_Output_Enable           _bit14
-#define GPFO_1_Output_Enable           _bit15
-
 /* Additional windowed registers unique to E series */
 
 /* 16 bit registers shadowed from DAQ-STC */