]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
staging: comedi: daqboard2000: redo DAC control register macros
authorIan Abbott <abbotti@mev.co.uk>
Thu, 19 May 2016 18:15:22 +0000 (19:15 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Jun 2016 03:57:54 +0000 (20:57 -0700)
Rename the macros used to define values for the DAC control register to
avoid CamelCase and to make it clearer which register they are
associated with.  Refactor the macros used to define values to enable or
disable DAC channels to use the channel number as a parameter.  None of
these macros are currently used by the driver.

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

index fd35ddf376d4389a69ddbb7b3adbf1511e2eb457..7d5f647c12556bd5dd49c94b01daebae9e30af83 100644 (file)
@@ -225,20 +225,13 @@ static const struct comedi_lrange range_daqboard2000_ai = {
 #define DAQBOARD2000_Dac3Busy                    0x0080
 
 /* DAC control */
-#define DAQBOARD2000_Dac0Enable                  0x0021
-#define DAQBOARD2000_Dac1Enable                  0x0031
-#define DAQBOARD2000_Dac2Enable                  0x0041
-#define DAQBOARD2000_Dac3Enable                  0x0051
-#define DAQBOARD2000_DacEnableBit                0x0001
-#define DAQBOARD2000_Dac0Disable                 0x0020
-#define DAQBOARD2000_Dac1Disable                 0x0030
-#define DAQBOARD2000_Dac2Disable                 0x0040
-#define DAQBOARD2000_Dac3Disable                 0x0050
-#define DAQBOARD2000_DacResetFifo                0x0004
-#define DAQBOARD2000_DacPatternDisable           0x0060
-#define DAQBOARD2000_DacPatternEnable            0x0061
-#define DAQBOARD2000_DacSelectSignedData         0x0002
-#define DAQBOARD2000_DacSelectUnsignedData       0x0000
+#define DB2K_DAC_CONTROL_ENABLE_BIT                    0x0001
+#define DB2K_DAC_CONTROL_DATA_IS_SIGNED                        0x0002
+#define DB2K_DAC_CONTROL_RESET_FIFO                    0x0004
+#define DB2K_DAC_CONTROL_DAC_DISABLE(x)                        (0x0020 + ((x) << 4))
+#define DB2K_DAC_CONTROL_DAC_ENABLE(x)                 (0x0021 + ((x) << 4))
+#define DB2K_DAC_CONTROL_PATTERN_DISABLE               0x0060
+#define DB2K_DAC_CONTROL_PATTERN_ENABLE                        0x0061
 
 /* Trigger Control */
 #define DAQBOARD2000_TrigAnalog                  0x0000