Re: [PATCH v3 2/7] pwm: axi-pwmgen: report the waveform step
From: Jonathan Cameron
Date: Fri Nov 06 2026 - 20:53:23 EST
On Fri, 6 Nov 2026 18:05:14 +0200
Nicolae-Daniel Deaconescu <Nicolae-daniel.Deaconescu@xxxxxxxxxx> wrote:
> The period, duty and offset counters of the AXI PWM generator count cycles
> of its external clock, without a divider. Report that clock rate and one
> cycle per step.
>
> Signed-off-by: Nicolae-Daniel Deaconescu <Nicolae-daniel.Deaconescu@xxxxxxxxxx>
> ---
> drivers/pwm/pwm-axi-pwmgen.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/pwm/pwm-axi-pwmgen.c b/drivers/pwm/pwm-axi-pwmgen.c
> index b40522f01002..6b15244efabf 100644
> --- a/drivers/pwm/pwm-axi-pwmgen.c
> +++ b/drivers/pwm/pwm-axi-pwmgen.c
> @@ -136,6 +136,18 @@ static int axi_pwmgen_round_waveform_fromhw(struct pwm_chip *chip, struct pwm_de
> return 0;
> }
>
> +static int axi_pwmgen_get_waveform_step(struct pwm_chip *chip,
> + struct pwm_device *pwm,
> + struct pwm_waveform_step *step)
> +{
> + struct axi_pwmgen_ddata *ddata = axi_pwmgen_ddata_from_chip(chip);
> +
> + step->clk_rate_Hz = ddata->clk_rate_hz;
> + step->clk_cycles_per_step = 1;
Given the only known user sets cycles_per_step to 1, what evidence
do we have that part of the interface is actually useful?
I can theorise that some device might need a couple of clocks
but can also theorise someone might use both edges of the clock as possible
state transition points for a PWM.
Note my PWM knowledge is minimal so this may be entirely garbage!
Jonathan