Skip to content

Commit 2e82d58

Browse files
dlechUwe Kleine-König
authored andcommitted
pwm: axi-pwmgen: Rename 0x10 register
Rename the 0x10 register from REG_CONFIG to REG_RSTN. Also rename the associated bit macros accordingly. While touching this, move the bit macros close to the register address macro for better organization. According to [1], the name of the 0x10 register is REG_RSTN, and there is a different register named REG_CONFIG (0x18). So we should not be using REG_CONFIG for the 0x10 register to avoid confusion. [1]: http://analogdevicesinc.github.io/hdl/library/axi_pwm_gen/index.html Signed-off-by: David Lechner <[email protected]> Reviewed-by: Nuno Sa <[email protected]> Link: https://lore.kernel.org/r/20241009-pwm-axi-pwmgen-enable-force_align-v1-1-5d6ad8cbf5b4@baylibre.com Signed-off-by: Uwe Kleine-König <[email protected]>
1 parent 3c25a3d commit 2e82d58

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/pwm/pwm-axi-pwmgen.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
* Limitations:
1111
* - The writes to registers for period and duty are shadowed until
12-
* LOAD_CONFIG is written to AXI_PWMGEN_REG_CONFIG, at which point
12+
* LOAD_CONFIG is written to AXI_PWMGEN_REG_RSTN, at which point
1313
* they take effect.
1414
* - Writing LOAD_CONFIG also has the effect of re-synchronizing all
1515
* enabled channels, which could cause glitching on other channels. It
@@ -33,14 +33,14 @@
3333
#define AXI_PWMGEN_REG_ID 0x04
3434
#define AXI_PWMGEN_REG_SCRATCHPAD 0x08
3535
#define AXI_PWMGEN_REG_CORE_MAGIC 0x0C
36-
#define AXI_PWMGEN_REG_CONFIG 0x10
36+
#define AXI_PWMGEN_REG_RSTN 0x10
37+
#define AXI_PWMGEN_REG_RSTN_LOAD_CONFIG BIT(1)
38+
#define AXI_PWMGEN_REG_RSTN_RESET BIT(0)
3739
#define AXI_PWMGEN_REG_NPWM 0x14
3840
#define AXI_PWMGEN_CHX_PERIOD(ch) (0x40 + (4 * (ch)))
3941
#define AXI_PWMGEN_CHX_DUTY(ch) (0x80 + (4 * (ch)))
4042
#define AXI_PWMGEN_CHX_OFFSET(ch) (0xC0 + (4 * (ch)))
4143
#define AXI_PWMGEN_REG_CORE_MAGIC_VAL 0x601A3471 /* Identification number to test during setup */
42-
#define AXI_PWMGEN_LOAD_CONFIG BIT(1)
43-
#define AXI_PWMGEN_REG_CONFIG_RESET BIT(0)
4444

4545
struct axi_pwmgen_ddata {
4646
struct regmap *regmap;
@@ -152,7 +152,7 @@ static int axi_pwmgen_write_waveform(struct pwm_chip *chip,
152152
if (ret)
153153
return ret;
154154

155-
return regmap_write(regmap, AXI_PWMGEN_REG_CONFIG, AXI_PWMGEN_LOAD_CONFIG);
155+
return regmap_write(regmap, AXI_PWMGEN_REG_RSTN, AXI_PWMGEN_REG_RSTN_LOAD_CONFIG);
156156
}
157157

158158
static int axi_pwmgen_read_waveform(struct pwm_chip *chip,
@@ -223,7 +223,7 @@ static int axi_pwmgen_setup(struct regmap *regmap, struct device *dev)
223223
}
224224

225225
/* Enable the core */
226-
ret = regmap_clear_bits(regmap, AXI_PWMGEN_REG_CONFIG, AXI_PWMGEN_REG_CONFIG_RESET);
226+
ret = regmap_clear_bits(regmap, AXI_PWMGEN_REG_RSTN, AXI_PWMGEN_REG_RSTN_RESET);
227227
if (ret)
228228
return ret;
229229

0 commit comments

Comments
 (0)