Add missing generic #pwm-cells on STM32 LPTimer to allow initialization
of channel, period and polarity.
Fabrice Gasnier (1):
ARM: dts: stm32: update pwm-cells for LPTimer on stm32h743
Gerald Baeza (2):
dt-bindings: pwm-stm32-lp: add #pwm-cells
pwm: stm32: LPTimer: use 3 cells xlate
Documentation/devicetree/bindings/pwm/pwm-stm32-lp.txt | 3 +++
arch/arm/boot/dts/stm32h743.dtsi | 5 +++++
drivers/pwm/pwm-stm32-lp.c | 2 ++
3 files changed, 10 insertions(+)
--
1.9.1
From: Gerald Baeza <[email protected]>
STM32 Low-Power Timer supports generic 3 cells pwm to encode
PWM number, period and polarity.
Signed-off-by: Gerald Baeza <[email protected]>
Signed-off-by: Fabrice Gasnier <[email protected]>
---
Documentation/devicetree/bindings/pwm/pwm-stm32-lp.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/Documentation/devicetree/bindings/pwm/pwm-stm32-lp.txt b/Documentation/devicetree/bindings/pwm/pwm-stm32-lp.txt
index f8338d1..bd23302 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-stm32-lp.txt
+++ b/Documentation/devicetree/bindings/pwm/pwm-stm32-lp.txt
@@ -7,6 +7,8 @@ See ../mfd/stm32-lptimer.txt for details about the parent node.
Required parameters:
- compatible: Must be "st,stm32-pwm-lp".
+- #pwm-cells: Should be set to 3. This PWM chip uses the default 3 cells
+ bindings defined in pwm.txt.
Optional properties:
- pinctrl-names: Set to "default".
@@ -18,6 +20,7 @@ Example:
...
pwm {
compatible = "st,stm32-pwm-lp";
+ #pwm-cells = <3>;
pinctrl-names = "default";
pinctrl-0 = <&lppwm1_pins>;
};
--
1.9.1
From: Gerald Baeza <[email protected]>
STM32 Low-Power Timer supports generic 3 cells pwm to encode
PWM number, period and polarity.
Signed-off-by: Gerald Baeza <[email protected]>
Signed-off-by: Fabrice Gasnier <[email protected]>
---
drivers/pwm/pwm-stm32-lp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/pwm/pwm-stm32-lp.c b/drivers/pwm/pwm-stm32-lp.c
index 1ac9e43..346b7bd 100644
--- a/drivers/pwm/pwm-stm32-lp.c
+++ b/drivers/pwm/pwm-stm32-lp.c
@@ -203,6 +203,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)
--
1.9.1
LPTimer pwm cells should be updated to 3, to allow initialization of
channel, period and polarity.
Signed-off-by: Fabrice Gasnier <[email protected]>
---
arch/arm/boot/dts/stm32h743.dtsi | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/arch/arm/boot/dts/stm32h743.dtsi b/arch/arm/boot/dts/stm32h743.dtsi
index bbfcbac..40d7d76 100644
--- a/arch/arm/boot/dts/stm32h743.dtsi
+++ b/arch/arm/boot/dts/stm32h743.dtsi
@@ -85,6 +85,7 @@
pwm {
compatible = "st,stm32-pwm-lp";
+ #pwm-cells = <3>;
status = "disabled";
};
@@ -238,6 +239,7 @@
pwm {
compatible = "st,stm32-pwm-lp";
+ #pwm-cells = <3>;
status = "disabled";
};
@@ -264,6 +266,7 @@
pwm {
compatible = "st,stm32-pwm-lp";
+ #pwm-cells = <3>;
status = "disabled";
};
@@ -285,6 +288,7 @@
pwm {
compatible = "st,stm32-pwm-lp";
+ #pwm-cells = <3>;
status = "disabled";
};
};
@@ -300,6 +304,7 @@
pwm {
compatible = "st,stm32-pwm-lp";
+ #pwm-cells = <3>;
status = "disabled";
};
};
--
1.9.1
On Thu, Feb 01, 2018 at 02:44:36PM +0100, Fabrice Gasnier wrote:
> From: Gerald Baeza <[email protected]>
>
> STM32 Low-Power Timer supports generic 3 cells pwm to encode
> PWM number, period and polarity.
>
> Signed-off-by: Gerald Baeza <[email protected]>
> Signed-off-by: Fabrice Gasnier <[email protected]>
> ---
> Documentation/devicetree/bindings/pwm/pwm-stm32-lp.txt | 3 +++
> 1 file changed, 3 insertions(+)
Reviewed-by: Rob Herring <[email protected]>