2018-02-23 13:38:30

by Fabrice Gasnier

[permalink] [raw]
Subject: [RESEND PATCH 0/3] Add pwm-cells on STM32 LPTimer

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



2018-02-23 13:38:09

by Fabrice Gasnier

[permalink] [raw]
Subject: [RESEND PATCH 1/3] dt-bindings: pwm-stm32-lp: add #pwm-cells

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]>
Reviewed-by: Rob Herring <[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


2018-02-23 13:39:24

by Fabrice Gasnier

[permalink] [raw]
Subject: [RESEND PATCH 3/3] ARM: dts: stm32: update pwm-cells for LPTimer on stm32h743

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


2018-02-23 13:40:36

by Fabrice Gasnier

[permalink] [raw]
Subject: [RESEND PATCH 2/3] pwm: stm32: LPTimer: use 3 cells xlate

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


2018-03-23 15:29:53

by Fabrice Gasnier

[permalink] [raw]
Subject: Re: [RESEND PATCH 2/3] pwm: stm32: LPTimer: use 3 cells xlate

On 02/23/2018 02:36 PM, 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]>
> ---
> 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)
>

Hi Thierry, all,

Gentle ping for driver review since DT Bindings has been reviewed by Rob.

Many thanks in advance,
Regards,
Fabrice

2018-03-27 22:59:32

by Thierry Reding

[permalink] [raw]
Subject: Re: [RESEND PATCH 0/3] Add pwm-cells on STM32 LPTimer

On Fri, Feb 23, 2018 at 02:36:02PM +0100, Fabrice Gasnier wrote:
> 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(+)

Applied patches 1 and 2, thanks.

Thierry


Attachments:
(No filename) (676.00 B)
signature.asc (849.00 B)
Download all attachments

2018-05-03 15:39:33

by Alexandre Torgue

[permalink] [raw]
Subject: Re: [RESEND PATCH 3/3] ARM: dts: stm32: update pwm-cells for LPTimer on stm32h743

Hi Fabrice

On 02/23/2018 02:36 PM, Fabrice Gasnier wrote:
> LPTimer pwm cells should be updated to 3, to allow initialization of
> channel, period and polarity.
>
> Signed-off-by: Fabrice Gasnier <[email protected]>
> ---


Applied on stm32-next.

Thanks.
Alex


> 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";
> };
> };
>