Browse Source

pwm: stm32: LPTimer: Use 3 cells ->of_xlate()

STM32 Low-Power Timer supports generic 3 cells PWM to encode PWM number,
period and polarity.

Signed-off-by: Gerald Baeza <gerald.baeza@st.com>
Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Gerald Baeza 7 years ago
parent
commit
f6ea025f6e
1 changed files with 2 additions and 0 deletions
  1. 2 0
      drivers/pwm/pwm-stm32-lp.c

+ 2 - 0
drivers/pwm/pwm-stm32-lp.c

@@ -202,6 +202,8 @@ static int stm32_pwm_lp_probe(struct platform_device *pdev)
 	priv->chip.dev = &pdev->dev;
 	priv->chip.ops = &stm32_pwm_lp_ops;
 	priv->chip.npwm = 1;
+	priv->chip.of_xlate = of_pwm_xlate_with_flags;
+	priv->chip.of_pwm_n_cells = 3;
 
 	ret = pwmchip_add(&priv->chip);
 	if (ret < 0)