mbox series

[0/5] Add missing pwm-cells to STM32 timers PWM

Message ID 1560937925-8990-1-git-send-email-fabrice.gasnier@st.com
Headers show
Series Add missing pwm-cells to STM32 timers PWM | expand

Message

Fabrice Gasnier June 19, 2019, 9:52 a.m. UTC
This series adds missing generic 3-cells PWM to STM32 timers dt-bindings,
PWM driver, and the relevant dtsi files for STM32F4, STM32F7 and STM32MP1.

Fabrice Gasnier (5):
  dt-bindings: pwm-stm32: add #pwm-cells
  pwm: stm32: use 3 cells ->of_xlate()
  ARM: dts: stm32: add pwm cells to stm32mp157c
  ARM: dts: stm32: add pwm cells to stm32f429
  ARM: dts: stm32: add pwm cells to stm32f746

 Documentation/devicetree/bindings/pwm/pwm-stm32.txt |  3 +++
 arch/arm/boot/dts/stm32f429.dtsi                    | 12 ++++++++++++
 arch/arm/boot/dts/stm32f746.dtsi                    | 12 ++++++++++++
 arch/arm/boot/dts/stm32mp157c.dtsi                  | 12 ++++++++++++
 drivers/pwm/pwm-stm32.c                             |  2 ++
 5 files changed, 41 insertions(+)

Comments

Benjamin GAIGNARD June 19, 2019, 11:42 a.m. UTC | #1
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@st.com>
>
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@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;
Alexandre TORGUE July 29, 2019, 7:22 a.m. UTC | #2
Hi Fabrice

On 6/19/19 11:52 AM, Fabrice Gasnier wrote:
> This series adds missing generic 3-cells PWM to STM32 timers dt-bindings,
> PWM driver, and the relevant dtsi files for STM32F4, STM32F7 and STM32MP1.
> 
> Fabrice Gasnier (5):
>    dt-bindings: pwm-stm32: add #pwm-cells
>    pwm: stm32: use 3 cells ->of_xlate()
>    ARM: dts: stm32: add pwm cells to stm32mp157c
>    ARM: dts: stm32: add pwm cells to stm32f429
>    ARM: dts: stm32: add pwm cells to stm32f746
> 
>   Documentation/devicetree/bindings/pwm/pwm-stm32.txt |  3 +++
>   arch/arm/boot/dts/stm32f429.dtsi                    | 12 ++++++++++++
>   arch/arm/boot/dts/stm32f746.dtsi                    | 12 ++++++++++++
>   arch/arm/boot/dts/stm32mp157c.dtsi                  | 12 ++++++++++++
>   drivers/pwm/pwm-stm32.c                             |  2 ++
>   5 files changed, 41 insertions(+)
> 

DT patches applied on stm32-next.

regards
Alex