[PATCH 11/19] staging: comedi: ni_tio: tidy up Gi_DMA_Config_Reg_Bits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Convert this enum into defines and rename the CamelCase symbols.

For aesthetics, move the new defines so they are associated with
the register define.

Signed-off-by: H Hartley Sweeten <hsweeten@xxxxxxxxxxxxxxxxxxx>
Cc: Ian Abbott <abbotti@xxxxxxxxx>
Cc: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/staging/comedi/drivers/ni_stc.h          |  8 --------
 drivers/staging/comedi/drivers/ni_tio_internal.h | 11 +++++------
 drivers/staging/comedi/drivers/ni_tiocmd.c       | 10 +++++-----
 3 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h
index caad9d8..a284129 100644
--- a/drivers/staging/comedi/drivers/ni_stc.h
+++ b/drivers/staging/comedi/drivers/ni_stc.h
@@ -1285,14 +1285,6 @@ static inline unsigned MSeries_PFI_Output_Select_Source(unsigned channel,
 	return (bits >> ((channel % 3) * 5)) & 0x1f;
 };
 
-enum MSeries_Gi_DMA_Config_Bits {
-	Gi_DMA_BankSW_Error_Bit = 0x10,
-	Gi_DMA_Reset_Bit = 0x8,
-	Gi_DMA_Int_Enable_Bit = 0x4,
-	Gi_DMA_Write_Bit = 0x2,
-	Gi_DMA_Enable_Bit = 0x1,
-};
-
 static inline unsigned MSeries_PFI_Filter_Select_Mask(unsigned channel)
 {
 	return 0x3 << (channel * 2);
diff --git a/drivers/staging/comedi/drivers/ni_tio_internal.h b/drivers/staging/comedi/drivers/ni_tio_internal.h
index 18a1e16..a74cec4 100644
--- a/drivers/staging/comedi/drivers/ni_tio_internal.h
+++ b/drivers/staging/comedi/drivers/ni_tio_internal.h
@@ -133,18 +133,17 @@
 #define GI_HW_SAVE(x)			(((x) % 2) ? (1 << 13) : (1 << 12))
 #define GI_PERMANENT_STALE(x)		(((x) % 2) ? (1 << 15) : (1 << 14))
 #define NITIO_DMA_CFG_REG(x)		(NITIO_G0_DMA_CFG + (x))
+#define GI_DMA_ENABLE			(1 << 0)
+#define GI_DMA_WRITE			(1 << 1)
+#define GI_DMA_INT_ENA			(1 << 2)
+#define GI_DMA_RESET			(1 << 3)
+#define GI_DMA_BANKSW_ERROR		(1 << 4)
 #define NITIO_DMA_STATUS_REG(x)		(NITIO_G0_DMA_STATUS + (x))
 #define NITIO_ABZ_REG(x)		(NITIO_G0_ABZ + (x))
 #define NITIO_INT_ACK_REG(x)		(NITIO_G0_INT_ACK + (x))
 #define NITIO_STATUS_REG(x)		(NITIO_G0_STATUS + (x))
 #define NITIO_INT_ENA_REG(x)		(NITIO_G0_INT_ENA + (x))
 
-enum Gi_DMA_Config_Reg_Bits {
-	Gi_DMA_Enable_Bit = 0x1,
-	Gi_DMA_Write_Bit = 0x2,
-	Gi_DMA_Int_Bit = 0x4
-};
-
 enum Gi_DMA_Status_Reg_Bits {
 	Gi_DMA_Readbank_Bit = 0x2000,
 	Gi_DRQ_Error_Bit = 0x4000,
diff --git a/drivers/staging/comedi/drivers/ni_tiocmd.c b/drivers/staging/comedi/drivers/ni_tiocmd.c
index 9ba4079..d80bb35 100644
--- a/drivers/staging/comedi/drivers/ni_tiocmd.c
+++ b/drivers/staging/comedi/drivers/ni_tiocmd.c
@@ -74,14 +74,14 @@ static void ni_tio_configure_dma(struct ni_gpct *counter, short enable,
 			unsigned gi_dma_config_bits = 0;
 
 			if (enable) {
-				gi_dma_config_bits |= Gi_DMA_Enable_Bit;
-				gi_dma_config_bits |= Gi_DMA_Int_Bit;
+				gi_dma_config_bits |= GI_DMA_ENABLE;
+				gi_dma_config_bits |= GI_DMA_INT_ENA;
 			}
 			if (read_not_write == 0)
-				gi_dma_config_bits |= Gi_DMA_Write_Bit;
+				gi_dma_config_bits |= GI_DMA_WRITE;
 			ni_tio_set_bits(counter, NITIO_DMA_CFG_REG(cidx),
-					Gi_DMA_Enable_Bit | Gi_DMA_Int_Bit |
-					Gi_DMA_Write_Bit, gi_dma_config_bits);
+					GI_DMA_ENABLE | GI_DMA_INT_ENA |
+					GI_DMA_WRITE, gi_dma_config_bits);
 		}
 		break;
 	}
-- 
2.0.3

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux