From: H Hartley Sweeten Date: Mon, 28 Jul 2014 17:26:56 +0000 (-0700) Subject: staging: comedi: ni_tio: tidy up Gi_DMA_Config_Reg_Bits X-Git-Tag: firefly_0821_release~176^2~3491^2~148 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=150dde701f8cae00ecb0084316a9e60f5046de9c;p=firefly-linux-kernel-4.4.55.git staging: comedi: ni_tio: tidy up Gi_DMA_Config_Reg_Bits 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 Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h index caad9d86be8e..a2841292ddd4 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 18a1e16ba0a5..a74cec40611c 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 9ba40794ac21..d80bb35aed40 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; }