staging: comedi: ni_stc.h: tidy up AO_Configuration register and bits
Rename the CamelCase. Use the BIT() macro to define the bits. 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
d504a6ee3d
commit
b497b8da80
2 changed files with 15 additions and 15 deletions
|
@ -2675,27 +2675,27 @@ static int ni_old_ao_config_chanlist(struct comedi_device *dev,
|
||||||
for (i = 0; i < n_chans; i++) {
|
for (i = 0; i < n_chans; i++) {
|
||||||
chan = CR_CHAN(chanspec[i]);
|
chan = CR_CHAN(chanspec[i]);
|
||||||
range = CR_RANGE(chanspec[i]);
|
range = CR_RANGE(chanspec[i]);
|
||||||
conf = AO_Channel(chan);
|
conf = NI_E_AO_DACSEL(chan);
|
||||||
|
|
||||||
if (comedi_range_is_bipolar(s, range)) {
|
if (comedi_range_is_bipolar(s, range)) {
|
||||||
conf |= AO_Bipolar;
|
conf |= NI_E_AO_CFG_BIP;
|
||||||
invert = (s->maxdata + 1) >> 1;
|
invert = (s->maxdata + 1) >> 1;
|
||||||
} else {
|
} else {
|
||||||
invert = 0;
|
invert = 0;
|
||||||
}
|
}
|
||||||
if (comedi_range_is_external(s, range))
|
if (comedi_range_is_external(s, range))
|
||||||
conf |= AO_Ext_Ref;
|
conf |= NI_E_AO_EXT_REF;
|
||||||
|
|
||||||
/* not all boards can deglitch, but this shouldn't hurt */
|
/* not all boards can deglitch, but this shouldn't hurt */
|
||||||
if (chanspec[i] & CR_DEGLITCH)
|
if (chanspec[i] & CR_DEGLITCH)
|
||||||
conf |= AO_Deglitch;
|
conf |= NI_E_AO_DEGLITCH;
|
||||||
|
|
||||||
/* analog reference */
|
/* analog reference */
|
||||||
/* AREF_OTHER connects AO ground to AI ground, i think */
|
/* AREF_OTHER connects AO ground to AI ground, i think */
|
||||||
conf |= (CR_AREF(chanspec[i]) ==
|
if (CR_AREF(chanspec[i]) == AREF_OTHER)
|
||||||
AREF_OTHER) ? AO_Ground_Ref : 0;
|
conf |= NI_E_AO_GROUND_REF;
|
||||||
|
|
||||||
ni_writew(dev, conf, AO_Configuration);
|
ni_writew(dev, conf, NI_E_AO_CFG_REG);
|
||||||
devpriv->ao_conf[chan] = conf;
|
devpriv->ao_conf[chan] = conf;
|
||||||
}
|
}
|
||||||
return invert;
|
return invert;
|
||||||
|
@ -3698,7 +3698,7 @@ static void init_ao_67xx(struct comedi_device *dev, struct comedi_subdevice *s)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < s->n_chan; i++) {
|
for (i = 0; i < s->n_chan; i++) {
|
||||||
ni_ao_win_outw(dev, AO_Channel(i) | 0x0,
|
ni_ao_win_outw(dev, NI_E_AO_DACSEL(i) | 0x0,
|
||||||
AO_Configuration_2_67xx);
|
AO_Configuration_2_67xx);
|
||||||
}
|
}
|
||||||
ni_ao_win_outw(dev, 0x0, AO_Later_Single_Point_Updates);
|
ni_ao_win_outw(dev, 0x0, AO_Later_Single_Point_Updates);
|
||||||
|
|
|
@ -631,17 +631,17 @@ static inline unsigned GPCT_DMA_Select_Mask(unsigned gpct_index)
|
||||||
#define NI_E_AI_CFG_HI_AC_COUPLE BIT(11)
|
#define NI_E_AI_CFG_HI_AC_COUPLE BIT(11)
|
||||||
#define NI_E_AI_CFG_HI_CHAN(x) (((x) & 0x3f) << 0)
|
#define NI_E_AI_CFG_HI_CHAN(x) (((x) & 0x3f) << 0)
|
||||||
|
|
||||||
|
#define NI_E_AO_CFG_REG 0x16 /* w16 */
|
||||||
|
#define NI_E_AO_DACSEL(x) ((x) << 8)
|
||||||
|
#define NI_E_AO_GROUND_REF BIT(3)
|
||||||
|
#define NI_E_AO_EXT_REF BIT(2)
|
||||||
|
#define NI_E_AO_DEGLITCH BIT(1)
|
||||||
|
#define NI_E_AO_CFG_BIP BIT(0)
|
||||||
|
|
||||||
#define NI_E_8255_BASE 0x19 /* rw8 */
|
#define NI_E_8255_BASE 0x19 /* rw8 */
|
||||||
|
|
||||||
#define NI_E_AI_FIFO_DATA_REG 0x1c /* r16 */
|
#define NI_E_AI_FIFO_DATA_REG 0x1c /* r16 */
|
||||||
|
|
||||||
#define AO_Configuration 0x16
|
|
||||||
#define AO_Bipolar _bit0
|
|
||||||
#define AO_Deglitch _bit1
|
|
||||||
#define AO_Ext_Ref _bit2
|
|
||||||
#define AO_Ground_Ref _bit3
|
|
||||||
#define AO_Channel(x) ((x) << 8)
|
|
||||||
|
|
||||||
#define DAC_FIFO_Data 0x1e
|
#define DAC_FIFO_Data 0x1e
|
||||||
#define DAC0_Direct_Data 0x18
|
#define DAC0_Direct_Data 0x18
|
||||||
#define DAC1_Direct_Data 0x1a
|
#define DAC1_Direct_Data 0x1a
|
||||||
|
|
Loading…
Add table
Reference in a new issue