staging: comedi: quatech_daqp_cs: tidy up scanlist register bits
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 5 Oct 2015 21:22:58 +0000 (14:22 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Oct 2015 04:16:05 +0000 (21:16 -0700)
For aesthetics, move the bit defines for this register and 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/quatech_daqp_cs.c

index 29eb5bcaa9f529ec833a4c564b75facb6ca8a377..8d8ffd371a08578b9abb9b84ec83c2054a495155 100644 (file)
  * access the 16-bit data. Data is transferred LSB then MSB.
  */
 #define DAQP_AI_FIFO_REG               0x00
+
 #define DAQP_SCANLIST_REG              0x01
+#define DAQP_SCANLIST_DIFFERENTIAL     BIT(14)
+#define DAQP_SCANLIST_GAIN(x)          (((x) & 0x3) << 12)
+#define DAQP_SCANLIST_CHANNEL(x)       (((x) & 0xf) << 8)
+#define DAQP_SCANLIST_START            BIT(7)
+#define DAQP_SCANLIST_EXT_GAIN(x)      (((x) & 0x3) << 4)
+#define DAQP_SCANLIST_EXT_CHANNEL(x)   (((x) & 0xf) << 0)
+
 #define DAQP_CTRL_REG                  0x02
 #define DAQP_STATUS_REG                        0x02
 #define DAQP_DI_REG                    0x03
 #define DAQP_TIMER_REG                 0x0a
 #define DAQP_AUX_REG                   0x0f
 
-#define DAQP_SCANLIST_DIFFERENTIAL     0x4000
-#define DAQP_SCANLIST_GAIN(x)          ((x) << 12)
-#define DAQP_SCANLIST_CHANNEL(x)       ((x) << 8)
-#define DAQP_SCANLIST_START            0x0080
-#define DAQP_SCANLIST_EXT_GAIN(x)      ((x) << 4)
-#define DAQP_SCANLIST_EXT_CHANNEL(x)   (x)
-
 #define DAQP_CONTROL_PACER_CLK(x)      (((x) & 0x3) << 6)
 #define DAQP_CONTROL_PACER_CLK_EXT     DAQP_CONTROL_PACER_CLK(0)
 #define DAQP_CONTROL_PACER_CLK_5MHZ    DAQP_CONTROL_PACER_CLK(1)