Re: [PATCH RESEND v4 1/4] pwm: Imagination Technologies PWM DAC driver
From: Andrew Bresticker <hidden>
Date: 2014-11-24 17:47:41
Also in:
linux-pwm
From: Andrew Bresticker <hidden>
Date: 2014-11-24 17:47:41
Also in:
linux-pwm
quoted
quoted
diff --git a/drivers/pwm/pwm-img.c b/drivers/pwm/pwm-img.c[...]quoted
quoted
+/* PWM registers */ +#define CR_PWM_CTRL_CFG 0x0000 +#define CR_PWM_CTRL_CFG_NO_SUB_DIV 0 +#define CR_PWM_CTRL_CFG_SUB_DIV0 1 +#define CR_PWM_CTRL_CFG_SUB_DIV1 2 +#define CR_PWM_CTRL_CFG_SUB_DIV0_DIV1 3 +#define CR_PWM_CTRL_CFG_DIV_SHIFT(ch) ((ch) * 2 + 4) +#define CR_PWM_CTRL_CFG_DIV_MASK 0x3 + +#define CR_PWM_CH_CFG(ch) (0x4 + (ch) * 4) +#define CR_PWM_CH_CFG_TMBASE_SHIFT 0 +#define CR_PWM_CH_CFG_DUTY_SHIFT 16quoted
What's with the CR_ prefix here? What does it stand for? Can't you just drop it?CR stands for Control Register. We have picked it from the datasheet and wanted to make the register names compatible with the same in the datasheet. Hope Andrew agrees with Thierry's comments here. Hope we can drop it. Andrew, any comments here, please.
I didn't think the CR_ prefix was totally necessary, but it matches what's in the TRM, so I didn't have an issue with it. I'm fine with dropping it.