]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
staging: comedi: ni_stc.h: tidy up Configuration_Memory_Low register and bits
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Fri, 1 May 2015 21:59:57 +0000 (14:59 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 9 May 2015 17:05:17 +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 74817f8a2728d5a9d3b92f65d3013155a5734f72..0fba36dabd5b28201b21535ac817316bb12020e7 100644 (file)
@@ -1902,13 +1902,14 @@ static void ni_load_channelgain_list(struct comedi_device *dev,
                ni_writew(dev, hi, Configuration_Memory_High);
 
                if (!devpriv->is_6143) {
-                       lo = range;
+                       lo = NI_E_AI_CFG_LO_GAIN(range);
+
                        if (i == n_chan - 1)
-                               lo |= AI_LAST_CHANNEL;
+                               lo |= NI_E_AI_CFG_LO_LAST_CHAN;
                        if (dither)
-                               lo |= AI_DITHER;
+                               lo |= NI_E_AI_CFG_LO_DITHER;
 
-                       ni_writew(dev, lo, Configuration_Memory_Low);
+                       ni_writew(dev, lo, NI_E_AI_CFG_LO_REG);
                }
        }
 
index ea5999c8a9079c4d60b690199b5b8cd6f08cd330..8abf78db47bc721d34c36e5055eaaa1ca4990c29 100644 (file)
@@ -616,13 +616,13 @@ static inline unsigned GPCT_DMA_Select_Mask(unsigned gpct_index)
        return 0xf << (4 * gpct_index);
 }
 
-/* 16 bit registers */
+#define NI_E_AI_CFG_LO_REG             0x10    /* w16 */
+#define NI_E_AI_CFG_LO_LAST_CHAN       BIT(15)
+#define NI_E_AI_CFG_LO_GEN_TRIG                BIT(12)
+#define NI_E_AI_CFG_LO_DITHER          BIT(9)
+#define NI_E_AI_CFG_LO_UNI             BIT(8)
+#define NI_E_AI_CFG_LO_GAIN(x)         ((x) << 0)
 
-#define Configuration_Memory_Low       0x10
-enum Configuration_Memory_Low_Bits {
-       AI_DITHER = 0x200,
-       AI_LAST_CHANNEL = 0x8000,
-};
 #define Configuration_Memory_High      0x12
 enum Configuration_Memory_High_Bits {
        AI_AC_COUPLE = 0x800,