staging: comedi: ni_mio_common: move ni_stc_dma_channel_select_bitfield()
Move this inline helper function from ni_stc.h. It does not need to be exposed outside of this file. 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:
parent
7d6f3aaead
commit
f78476b4d3
2 changed files with 11 additions and 12 deletions
|
@ -567,6 +567,17 @@ static inline void ni_set_bitfield(struct comedi_device *dev, int reg,
|
||||||
|
|
||||||
#ifdef PCIDMA
|
#ifdef PCIDMA
|
||||||
/* DMA channel setup */
|
/* DMA channel setup */
|
||||||
|
static inline unsigned ni_stc_dma_channel_select_bitfield(unsigned channel)
|
||||||
|
{
|
||||||
|
if (channel < 4)
|
||||||
|
return 1 << channel;
|
||||||
|
if (channel == 4)
|
||||||
|
return 0x3;
|
||||||
|
if (channel == 5)
|
||||||
|
return 0x5;
|
||||||
|
BUG();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
/* negative channel means no channel */
|
/* negative channel means no channel */
|
||||||
static inline void ni_set_ai_dma_channel(struct comedi_device *dev, int channel)
|
static inline void ni_set_ai_dma_channel(struct comedi_device *dev, int channel)
|
||||||
|
|
|
@ -592,18 +592,6 @@
|
||||||
#define NI_E_MISC_CMD_EXT_ATRIG NI_E_MISC_CMD_INTEXT_ATRIG(0)
|
#define NI_E_MISC_CMD_EXT_ATRIG NI_E_MISC_CMD_INTEXT_ATRIG(0)
|
||||||
#define NI_E_MISC_CMD_INT_ATRIG NI_E_MISC_CMD_INTEXT_ATRIG(1)
|
#define NI_E_MISC_CMD_INT_ATRIG NI_E_MISC_CMD_INTEXT_ATRIG(1)
|
||||||
|
|
||||||
static inline unsigned ni_stc_dma_channel_select_bitfield(unsigned channel)
|
|
||||||
{
|
|
||||||
if (channel < 4)
|
|
||||||
return 1 << channel;
|
|
||||||
if (channel == 4)
|
|
||||||
return 0x3;
|
|
||||||
if (channel == 5)
|
|
||||||
return 0x5;
|
|
||||||
BUG();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define NI_E_AI_CFG_LO_REG 0x10 /* w16 */
|
#define NI_E_AI_CFG_LO_REG 0x10 /* w16 */
|
||||||
#define NI_E_AI_CFG_LO_LAST_CHAN BIT(15)
|
#define NI_E_AI_CFG_LO_LAST_CHAN BIT(15)
|
||||||
#define NI_E_AI_CFG_LO_GEN_TRIG BIT(12)
|
#define NI_E_AI_CFG_LO_GEN_TRIG BIT(12)
|
||||||
|
|
Loading…
Add table
Reference in a new issue