Commit b06afa15 authored by H Hartley Sweeten's avatar H Hartley Sweeten Committed by Greg Kroah-Hartman

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

Rename the CamelCase and convert the enum into defines. Use the BIT()
macro to define the bits.
Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
Reviewed-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent bae45304
...@@ -2675,12 +2675,12 @@ static int ni_m_series_ao_config_chanlist(struct comedi_device *dev, ...@@ -2675,12 +2675,12 @@ static int ni_m_series_ao_config_chanlist(struct comedi_device *dev,
break; break;
case 4000000: case 4000000:
conf |= NI_M_AO_CFG_BANK_REF_INT_10V; conf |= NI_M_AO_CFG_BANK_REF_INT_10V;
ni_writeb(dev, MSeries_Attenuate_x5_Bit, ni_writeb(dev, NI_M_AO_REF_ATTENUATION_X5,
NI_M_AO_REF_ATTENUATION_REG(chan)); NI_M_AO_REF_ATTENUATION_REG(chan));
break; break;
case 2000000: case 2000000:
conf |= NI_M_AO_CFG_BANK_REF_INT_5V; conf |= NI_M_AO_CFG_BANK_REF_INT_5V;
ni_writeb(dev, MSeries_Attenuate_x5_Bit, ni_writeb(dev, NI_M_AO_REF_ATTENUATION_X5,
NI_M_AO_REF_ATTENUATION_REG(chan)); NI_M_AO_REF_ATTENUATION_REG(chan));
break; break;
default: default:
......
...@@ -1037,10 +1037,7 @@ static const struct comedi_lrange range_ni_E_ao_ext; ...@@ -1037,10 +1037,7 @@ static const struct comedi_lrange range_ni_E_ao_ext;
#define NI_M_CDO_MASK_ENA_REG 0x234 #define NI_M_CDO_MASK_ENA_REG 0x234
#define NI_M_STATIC_AI_CTRL_REG(x) ((x) ? (0x260 + (x)) : 0x064) #define NI_M_STATIC_AI_CTRL_REG(x) ((x) ? (0x260 + (x)) : 0x064)
#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)
enum MSeries_AO_Reference_Attenuation_Bits {
MSeries_Attenuate_x5_Bit = 0x1
};
static inline unsigned MSeries_Cal_PWM_High_Time_Bits(unsigned count) static inline unsigned MSeries_Cal_PWM_High_Time_Bits(unsigned count)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment