]> git.karo-electronics.de Git - linux-beck.git/commitdiff
staging: comedi: comedi_8254.h: tidy up the register map defines
authorH Hartley Sweeten <hsweeten@visionengravers.com>
Mon, 11 Apr 2016 18:32:18 +0000 (11:32 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Apr 2016 05:14:20 +0000 (22:14 -0700)
Tidy up the defines to fix the checkpatch.pl issues:
CHECK: Prefer using the BIT macro

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/comedi_8254.h

index f4610ead61726317fe815cfbd6f117f6de968437..a12c29455d9d7e074a1377f08f476fe81f34a9ed 100644 (file)
@@ -53,13 +53,15 @@ struct comedi_subdevice;
 #define I8254_COUNTER2_REG             0x02
 #define I8254_CTRL_REG                 0x03
 #define I8254_CTRL_SEL_CTR(x)          ((x) << 6)
-#define I8254_CTRL_READBACK_COUNT      ((3 << 6) | (1 << 4))
-#define I8254_CTRL_READBACK_STATUS     ((3 << 6) | (1 << 5))
+#define I8254_CTRL_READBACK(x)         (I8254_CTRL_SEL_CTR(3) | BIT(x))
+#define I8254_CTRL_READBACK_COUNT      I8254_CTRL_READBACK(4)
+#define I8254_CTRL_READBACK_STATUS     I8254_CTRL_READBACK(5)
 #define I8254_CTRL_READBACK_SEL_CTR(x) (2 << (x))
-#define I8254_CTRL_LATCH               (0 << 4)
-#define I8254_CTRL_LSB_ONLY            (1 << 4)
-#define I8254_CTRL_MSB_ONLY            (2 << 4)
-#define I8254_CTRL_LSB_MSB             (3 << 4)
+#define I8254_CTRL_RW(x)               (((x) & 0x3) << 4)
+#define I8254_CTRL_LATCH               I8254_CTRL_RW(0)
+#define I8254_CTRL_LSB_ONLY            I8254_CTRL_RW(1)
+#define I8254_CTRL_MSB_ONLY            I8254_CTRL_RW(2)
+#define I8254_CTRL_LSB_MSB             I8254_CTRL_RW(3)
 
 /* counter maps zero to 0x10000 */
 #define I8254_MAX_COUNT                        0x10000