aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH Hartley Sweeten <hsweeten@visionengravers.com>2015-05-01 14:58:42 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-09 19:05:05 +0200
commitcc679f9746ea1fbdc00b53deda3c1dc6edc8d5f3 (patch)
tree8482579667df6a30d8cbb843989f2ad24d9a00fb
parentstaging: comedi: ni_stc.h: tidy up NI_M_AO_REF_ATTENUATION_REG bits (diff)
staging: comedi: ni_stc.h: tidy up NI_M_CAL_PWM_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>
-rw-r--r--drivers/staging/comedi/drivers/ni_mio_common.c4
-rw-r--r--drivers/staging/comedi/drivers/ni_stc.h12
2 files changed, 4 insertions, 12 deletions
diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c
index c100c0875e75..af095e621e9f 100644
--- a/drivers/staging/comedi/drivers/ni_mio_common.c
+++ b/drivers/staging/comedi/drivers/ni_mio_common.c
@@ -4016,8 +4016,8 @@ static int ni_m_series_pwm_config(struct comedi_device *dev,
data[4] = down_count * devpriv->clock_ns;
return -EAGAIN;
}
- ni_writel(dev, MSeries_Cal_PWM_High_Time_Bits(up_count) |
- MSeries_Cal_PWM_Low_Time_Bits(down_count),
+ ni_writel(dev, NI_M_CAL_PWM_HIGH_TIME(up_count) |
+ NI_M_CAL_PWM_LOW_TIME(down_count),
NI_M_CAL_PWM_REG);
devpriv->pwm_up_count = up_count;
devpriv->pwm_down_count = down_count;
diff --git a/drivers/staging/comedi/drivers/ni_stc.h b/drivers/staging/comedi/drivers/ni_stc.h
index 1ad7981914bb..33ed998890a0 100644
--- a/drivers/staging/comedi/drivers/ni_stc.h
+++ b/drivers/staging/comedi/drivers/ni_stc.h
@@ -936,6 +936,8 @@ static const struct comedi_lrange range_ni_E_ao_ext;
#define NI_M_DIO_REG 0x024
#define NI_M_DIO_DIR_REG 0x028
#define NI_M_CAL_PWM_REG 0x040
+#define NI_M_CAL_PWM_HIGH_TIME(x) (((x) & 0xffff) << 16)
+#define NI_M_CAL_PWM_LOW_TIME(x) (((x) & 0xffff) << 0)
#define NI_M_GEN_PWM_REG(x) (0x044 + ((x) * 2))
#define NI_M_AI_CFG_FIFO_DATA_REG 0x05e
#define NI_M_AI_CFG_LAST_CHAN BIT(14)
@@ -1039,16 +1041,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_X5 BIT(0)
-static inline unsigned MSeries_Cal_PWM_High_Time_Bits(unsigned count)
-{
- return (count << 16) & 0xffff0000;
-}
-
-static inline unsigned MSeries_Cal_PWM_Low_Time_Bits(unsigned count)
-{
- return count & 0xffff;
-}
-
static inline unsigned MSeries_PFI_Output_Select_Mask(unsigned channel)
{
return 0x1f << (channel % 3) * 5;