Skip to content

Commit 25afd8b

Browse files
alin724nunojsa
authored andcommitted
drivers: pwm: pwm-axi-pwmgen: Add support for 16 channels
Add support for up to 16 PWM output channels and update to the corresponding [period,width,offset] regs' addresses Signed-off-by: Alin-Tudor Sferle <Alin-Tudor.Sferle@analog.com>
1 parent 2d351aa commit 25afd8b

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
@@ -21,11 +21,11 @@
2121
#define AXI_PWMGEN_REG_CONFIG 0x10
2222
#define AXI_PWMGEN_REG_NPWM 0x14
2323
#define AXI_PWMGEN_CH_PERIOD_BASE 0x40
24-
#define AXI_PWMGEN_CH_DUTY_BASE 0x44
25-
#define AXI_PWMGEN_CH_PHASE_BASE 0x48
26-
#define AXI_PWMGEN_CHX_PERIOD(ch) (AXI_PWMGEN_CH_PERIOD_BASE + (12 * (ch)))
27-
#define AXI_PWMGEN_CHX_DUTY(ch) (AXI_PWMGEN_CH_DUTY_BASE + (12 * (ch)))
28-
#define AXI_PWMGEN_CHX_PHASE(ch) (AXI_PWMGEN_CH_PHASE_BASE + (12 * (ch)))
24+
#define AXI_PWMGEN_CH_DUTY_BASE 0x80
25+
#define AXI_PWMGEN_CH_PHASE_BASE 0xC0
26+
#define AXI_PWMGEN_CHX_PERIOD(ch) (AXI_PWMGEN_CH_PERIOD_BASE + (4 * (ch)))
27+
#define AXI_PWMGEN_CHX_DUTY(ch) (AXI_PWMGEN_CH_DUTY_BASE + (4 * (ch)))
28+
#define AXI_PWMGEN_CHX_PHASE(ch) (AXI_PWMGEN_CH_PHASE_BASE + (4 * (ch)))
2929
#define AXI_PWMGEN_TEST_DATA 0x5A0F0081
3030
#define AXI_PWMGEN_LOAD_CONIG BIT(1)
3131
#define AXI_PWMGEN_RESET BIT(0)
@@ -196,7 +196,7 @@ static int axi_pwmgen_setup(struct pwm_chip *chip)
196196
}
197197

198198
pwm->chip.npwm = axi_pwmgen_read(pwm, AXI_PWMGEN_REG_NPWM);
199-
if (pwm->chip.npwm > 4)
199+
if (pwm->chip.npwm > 16)
200200
return -EINVAL;
201201

202202
/* Disable all the outputs */

0 commit comments

Comments
 (0)