[Linux-stm32] [PATCH 2/5] pwm: stm32: use 3 cells ->of_xlate()

Benjamin GAIGNARD benjamin.gaignard at st.com
Wed Jun 19 11:42:22 UTC 2019


On 6/19/19 11:52 AM, Fabrice Gasnier wrote:
> STM32 Timers support generic 3 cells PWM to encode PWM number, period and
> polarity.
>
> Fixes: 7edf7369205b ("pwm: Add driver for STM32 plaftorm")
Reviewed-by: Benjamin Gaignard <benjamin.gaignard at st.com>
>
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier at st.com>
> ---
>   drivers/pwm/pwm-stm32.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c
> index 4f84255..740e2de 100644
> --- a/drivers/pwm/pwm-stm32.c
> +++ b/drivers/pwm/pwm-stm32.c
> @@ -608,6 +608,8 @@ static int stm32_pwm_probe(struct platform_device *pdev)
>   	priv->regmap = ddata->regmap;
>   	priv->clk = ddata->clk;
>   	priv->max_arr = ddata->max_arr;
> +	priv->chip.of_xlate = of_pwm_xlate_with_flags;
> +	priv->chip.of_pwm_n_cells = 3;
>   
>   	if (!priv->regmap || !priv->clk)
>   		return -EINVAL;


More information about the Linux-stm32 mailing list