staging: comedi: ni_stc.h: tidy up NI_M_PFI_FILTER_REG bits

Rename the CamelCase and convert the inline helper functions
that set the bits in this register to macros.

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>
This commit is contained in:
H Hartley Sweeten 2015-05-01 14:58:44 -07:00 committed by Greg Kroah-Hartman
parent 43e9d883f0
commit 0dee7ecc4d
2 changed files with 4 additions and 14 deletions

View file

@ -4419,8 +4419,8 @@ static int ni_config_filter(struct comedi_device *dev,
return -ENOTSUPP; return -ENOTSUPP;
bits = ni_readl(dev, NI_M_PFI_FILTER_REG); bits = ni_readl(dev, NI_M_PFI_FILTER_REG);
bits &= ~MSeries_PFI_Filter_Select_Mask(pfi_channel); bits &= ~NI_M_PFI_FILTER_SEL_MASK(pfi_channel);
bits |= MSeries_PFI_Filter_Select_Bits(pfi_channel, filter); bits |= NI_M_PFI_FILTER_SEL(pfi_channel, filter);
ni_writel(dev, bits, NI_M_PFI_FILTER_REG); ni_writel(dev, bits, NI_M_PFI_FILTER_REG);
return 0; return 0;
} }

View file

@ -963,6 +963,8 @@ static const struct comedi_lrange range_ni_E_ao_ext;
#define NI_M_AO_CALIB_REG 0x0a3 #define NI_M_AO_CALIB_REG 0x0a3
#define NI_M_AO_FIFO_DATA_REG 0x0a4 #define NI_M_AO_FIFO_DATA_REG 0x0a4
#define NI_M_PFI_FILTER_REG 0x0b0 #define NI_M_PFI_FILTER_REG 0x0b0
#define NI_M_PFI_FILTER_SEL(_c, _f) (((_f) & 0x3) << ((_c) * 2))
#define NI_M_PFI_FILTER_SEL_MASK(_c) NI_M_PFI_FILTER_SEL((_c), 0x3)
#define NI_M_RTSI_FILTER_REG 0x0b4 #define NI_M_RTSI_FILTER_REG 0x0b4
#define NI_M_SCXI_LEGACY_COMPAT_REG 0x0bc #define NI_M_SCXI_LEGACY_COMPAT_REG 0x0bc
#define NI_M_DAC_DIRECT_DATA_REG(x) (0x0c0 + ((x) * 4)) #define NI_M_DAC_DIRECT_DATA_REG(x) (0x0c0 + ((x) * 4))
@ -1045,18 +1047,6 @@ static const struct comedi_lrange range_ni_E_ao_ext;
#define NI_M_AO_REF_ATTENUATION_REG(x) (0x264 + (x)) #define NI_M_AO_REF_ATTENUATION_REG(x) (0x264 + (x))
#define NI_M_AO_REF_ATTENUATION_X5 BIT(0) #define NI_M_AO_REF_ATTENUATION_X5 BIT(0)
static inline unsigned MSeries_PFI_Filter_Select_Mask(unsigned channel)
{
return 0x3 << (channel * 2);
}
static inline unsigned MSeries_PFI_Filter_Select_Bits(unsigned channel,
unsigned filter)
{
return (filter << (channel *
2)) & MSeries_PFI_Filter_Select_Mask(channel);
}
enum CDIO_DMA_Select_Bits { enum CDIO_DMA_Select_Bits {
CDI_DMA_Select_Shift = 0, CDI_DMA_Select_Shift = 0,
CDI_DMA_Select_Mask = 0xf, CDI_DMA_Select_Mask = 0xf,