summaryrefslogtreecommitdiff
path: root/drivers/staging/comedi/drivers/ni_stc.h
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2015-05-01 14:59:58 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-09 19:05:17 +0200
commitd504a6ee3db248e2ec3dc5e4304a381d5ba9bb6f (patch)
treeca7cd0849007d49c08d029c6f1cc7f360faa3c90 /drivers/staging/comedi/drivers/ni_stc.h
parent76efac7f525f2e9fffe9e751c29cd93aae96c710 (diff)
staging: comedi: ni_stc.h: tidy up Configuration_Memory_High register and bits
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>
Diffstat (limited to 'drivers/staging/comedi/drivers/ni_stc.h')
-rw-r--r--drivers/staging/comedi/drivers/ni_stc.h18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h
index 8abf78db47bc..14e4351b0aa8 100644
--- a/drivers/staging/comedi/drivers/ni_stc.h
+++ b/drivers/staging/comedi/drivers/ni_stc.h
@@ -623,17 +623,13 @@ static inline unsigned GPCT_DMA_Select_Mask(unsigned gpct_index)
#define NI_E_AI_CFG_LO_UNI BIT(8)
#define NI_E_AI_CFG_LO_GAIN(x) ((x) << 0)
-#define Configuration_Memory_High 0x12
-enum Configuration_Memory_High_Bits {
- AI_AC_COUPLE = 0x800,
- AI_DIFFERENTIAL = 0x1000,
- AI_COMMON = 0x2000,
- AI_GROUND = 0x3000,
-};
-static inline unsigned int AI_CONFIG_CHANNEL(unsigned int channel)
-{
- return channel & 0x3f;
-}
+#define NI_E_AI_CFG_HI_REG 0x12 /* w16 */
+#define NI_E_AI_CFG_HI_TYPE(x) (((x) & 0x7) << 12)
+#define NI_E_AI_CFG_HI_TYPE_DIFF NI_E_AI_CFG_HI_TYPE(1)
+#define NI_E_AI_CFG_HI_TYPE_COMMON NI_E_AI_CFG_HI_TYPE(2)
+#define NI_E_AI_CFG_HI_TYPE_GROUND NI_E_AI_CFG_HI_TYPE(3)
+#define NI_E_AI_CFG_HI_AC_COUPLE BIT(11)
+#define NI_E_AI_CFG_HI_CHAN(x) (((x) & 0x3f) << 0)
#define NI_E_8255_BASE 0x19 /* rw8 */