[PATCH v2 2/3] ti_pwm: Fix EHRPWM issue

Neha Malcom Francis n-francis at ti.com
Tue Jul 7 13:19:16 CEST 2026


On Mon, 06 Jul 2026 08:35:01 +0000, theodore.oviguian at etu.esisar.grenoble-inp.fr <theodore.oviguian at etu.esisar.grenoble-inp.fr> wrote:
> diff --git a/drivers/pwm/pwm-ti-ehrpwm.c b/drivers/pwm/pwm-ti-ehrpwm.c
> index 135ea3b4321..3a06da00b68 100644
> --- a/drivers/pwm/pwm-ti-ehrpwm.c
> +++ b/drivers/pwm/pwm-ti-ehrpwm.c
> @@ -333,6 +334,15 @@ static int ti_ehrpwm_disable(struct udevice *dev, uint channel)
>  	ti_ehrpwm_modify(aqcsfrc_val, aqcsfrc_mask,
>  			 priv->regs + TI_EHRPWM_AQCSFRC);
>  
> +	/*
> +	 * Disabling TBCLK on PWM disable
> +	 * Only if all channels are disabled
> +	 */
> +	priv->enabled[channel] = false;
> +	for (uint i = 0; i < TI_EHRPWM_NUM_CHANNELS; i++) {
> +		if (priv->enabled[i])
> +			return 0;
> +	}
>  	/* Disabling TBCLK on PWM disable */

Can probably remove this line since block comments mentions disabling TBCLK

> @@ -439,6 +449,9 @@ static int ti_ehrpwm_probe(struct udevice *dev)
>  		return err;
>  	}
>  
> +	for (uint i = 0; i < TI_EHRPWM_NUM_CHANNELS; i++)
> +		priv->enabled[i] = false;

priv_auto uses calloc so this loop is not needed

-- 
Neha Malcom Francis <n-francis at ti.com>


More information about the U-Boot mailing list