Devicetree
 help / color / mirror / Atom feed
* [PATCH 0/5] Add RZ/V2{M, MA} driver support
@ 2022-11-18 13:16 Biju Das
  2022-11-18 13:16 ` [PATCH 2/5] dt-bindings: pwm: Add RZ/V2M PWM binding Biju Das
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Biju Das @ 2022-11-18 13:16 UTC (permalink / raw)
  To: Thierry Reding, Rob Herring, Krzysztof Kozlowski,
	Michael Turquette, Stephen Boyd, Philipp Zabel
  Cc: Biju Das, Uwe Kleine-König, Geert Uytterhoeven, Magnus Damm,
	linux-pwm, devicetree, linux-renesas-soc, linux-clk,
	Fabrizio Castro

The RZ/V2{M, MA} PWM Timer (PWM) is composed of 16 channels. Linux is only
allowed access to channels 8 to 14 on RZ/V2M, while there is no restriction
for RZ/V2MA.

The RZ/V2{M, MA} PWM Timer (PWM) supports the following functions:
 * The PWM has 24-bit counters which operate at PWM_CLK (48 MHz).
 * The frequency division ratio for internal counter operation is selectable
    as PWM_CLK divided by 1, 16, 256, or 2048.
 * The period as well as the duty cycle is adjustable.
 * The low-level and high-level order of the PWM signals can be inverted.
 * The duty cycle of the PWM signal is selectable in the range from 0 to 100%.
 * The minimum resolution is 20.83 ns.
 * Three interrupt sources: Rising and falling edges of the PWM signal and
   clearing of the counter
 * Counter operation and the bus interface are asynchronous and both can
   operate independently of the magnitude relationship of the respective
   clock periods.

Note:
 Hardware manual for this IP can be found here
 https://www.renesas.com/in/en/document/mah/rzv2m-users-manual-hardware?language=en

Biju Das (5):
  clk: renesas: r9a09g011: Add PWM clock entries
  dt-bindings: pwm: Add RZ/V2M PWM binding
  pwm: Add support for RZ/V2M PWM driver
  arm64: dts: renesas: r9a09g011: Add pwm nodes
  arm64: dts: renesas: rzv2m evk: Enable pwm

 .../bindings/pwm/renesas,rzv2m-pwm.yaml       |  98 +++++
 .../boot/dts/renesas/r9a09g011-v2mevk2.dts    |  70 ++++
 arch/arm64/boot/dts/renesas/r9a09g011.dtsi    |  91 ++++
 drivers/clk/renesas/r9a09g011-cpg.c           |   9 +
 drivers/pwm/Kconfig                           |  11 +
 drivers/pwm/Makefile                          |   1 +
 drivers/pwm/pwm-rzv2m.c                       | 390 ++++++++++++++++++
 7 files changed, 670 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/renesas,rzv2m-pwm.yaml
 create mode 100644 drivers/pwm/pwm-rzv2m.c

-- 
2.25.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 2/5] dt-bindings: pwm: Add RZ/V2M PWM binding
  2022-11-18 13:16 [PATCH 0/5] Add RZ/V2{M, MA} driver support Biju Das
@ 2022-11-18 13:16 ` Biju Das
  2022-11-22 11:46   ` Krzysztof Kozlowski
  2022-11-24  8:43   ` Geert Uytterhoeven
  2022-11-18 13:16 ` [PATCH 4/5] arm64: dts: renesas: r9a09g011: Add pwm nodes Biju Das
  2022-11-18 13:16 ` [PATCH 5/5] arm64: dts: renesas: rzv2m evk: Enable pwm Biju Das
  2 siblings, 2 replies; 8+ messages in thread
From: Biju Das @ 2022-11-18 13:16 UTC (permalink / raw)
  To: Thierry Reding, Rob Herring, Krzysztof Kozlowski
  Cc: Biju Das, Uwe Kleine-König, linux-pwm, devicetree,
	Geert Uytterhoeven, Fabrizio Castro, linux-renesas-soc

Add device tree bindings for the RZ/V2{M, MA} PWM Timer (PWM).

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 .../bindings/pwm/renesas,rzv2m-pwm.yaml       | 98 +++++++++++++++++++
 1 file changed, 98 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pwm/renesas,rzv2m-pwm.yaml

diff --git a/Documentation/devicetree/bindings/pwm/renesas,rzv2m-pwm.yaml b/Documentation/devicetree/bindings/pwm/renesas,rzv2m-pwm.yaml
new file mode 100644
index 000000000000..d615213357ad
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/renesas,rzv2m-pwm.yaml
@@ -0,0 +1,98 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/renesas,rzv2m-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Renesas RZ/V2{M, MA} PWM Timer (PWM)
+
+maintainers:
+  - Biju Das <biju.das.jz@bp.renesas.com>
+
+description: |
+  The RZ/V2{M, MA} PWM Timer (PWM) composed of 16 channels. It supports the
+  following functions
+  * The PWM has 24-bit counters which operate at PWM_CLK (48 MHz).
+  * The frequency division ratio for internal counter operation is selectable
+    as PWM_CLK divided by 1, 16, 256, or 2048.
+  * The period as well as the duty cycle is adjustable.
+  * The low-level and high-level order of the PWM signals can be inverted.
+  * The duty cycle of the PWM signal is selectable in the range from 0 to 100%.
+  * The minimum resolution is 20.83 ns.
+  * Three interrupt sources: Rising and falling edges of the PWM signal and
+    clearing of the counter
+  * Counter operation and the bus interface are asynchronous and both can
+    operate independently of the magnitude relationship of the respective
+    clock periods.
+
+properties:
+  compatible:
+    items:
+      - enum:
+          - renesas,r9a09g011-pwm  # RZ/V2M
+          - renesas,r9a09g055-pwm  # RZ/V2MA
+      - const: renesas,rzv2m-pwm
+
+  reg:
+    maxItems: 1
+
+  '#pwm-cells':
+    const: 2
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: CPU Peripheral Group F APB clock
+      - description: PWM clock
+
+  clock-names:
+    items:
+      - const: apb
+      - const: pwm
+
+  power-domains:
+    maxItems: 1
+
+  resets:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - clock-names
+  - power-domains
+
+if:
+  properties:
+    compatible:
+      contains:
+        enum:
+          - renesas,r9a09g055-pwm
+then:
+  required:
+    - resets
+
+allOf:
+  - $ref: pwm.yaml#
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/clock/r9a09g011-cpg.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    pwm8: pwm@a4010400 {
+        compatible = "renesas,r9a09g011-pwm", "renesas,rzv2m-pwm";
+        reg = <0xa4010400 0x80>;
+        interrupts = <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>;
+        clocks = <&cpg CPG_MOD R9A09G011_CPERI_GRPF_PCLK>,
+                 <&cpg CPG_MOD R9A09G011_PWM8_CLK>;
+        clock-names = "apb", "pwm";
+        power-domains = <&cpg>;
+        #pwm-cells = <2>;
+    };
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/5] arm64: dts: renesas: r9a09g011: Add pwm nodes
  2022-11-18 13:16 [PATCH 0/5] Add RZ/V2{M, MA} driver support Biju Das
  2022-11-18 13:16 ` [PATCH 2/5] dt-bindings: pwm: Add RZ/V2M PWM binding Biju Das
@ 2022-11-18 13:16 ` Biju Das
  2022-11-18 13:16 ` [PATCH 5/5] arm64: dts: renesas: rzv2m evk: Enable pwm Biju Das
  2 siblings, 0 replies; 8+ messages in thread
From: Biju Das @ 2022-11-18 13:16 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: Biju Das, Geert Uytterhoeven, Magnus Damm, linux-renesas-soc,
	devicetree, Fabrizio Castro

Add device nodes for the pwm timer channels that are not assigned
to the ISP.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 arch/arm64/boot/dts/renesas/r9a09g011.dtsi | 91 ++++++++++++++++++++++
 1 file changed, 91 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r9a09g011.dtsi b/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
index 0373ec409d54..9a4690f8d18f 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a09g011.dtsi
@@ -135,6 +135,97 @@ sys: system-controller@a3f03000 {
 			reg = <0 0xa3f03000 0 0x400>;
 		};
 
+		pwm8: pwm@a4010400 {
+			compatible = "renesas,r9a09g011-pwm",
+				     "renesas,rzv2m-pwm";
+			reg = <0 0xa4010400 0 0x80>;
+			interrupts = <GIC_SPI 376 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD R9A09G011_CPERI_GRPF_PCLK>,
+				 <&cpg CPG_MOD R9A09G011_PWM8_CLK>;
+			clock-names = "apb", "pwm";
+			power-domains = <&cpg>;
+			#pwm-cells = <2>;
+			status = "disabled";
+		};
+
+		pwm9: pwm@a4010480 {
+			compatible = "renesas,r9a09g011-pwm",
+				     "renesas,rzv2m-pwm";
+			reg = <0 0xa4010480 0 0x80>;
+			interrupts = <GIC_SPI 377 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD R9A09G011_CPERI_GRPF_PCLK>,
+				 <&cpg CPG_MOD R9A09G011_PWM9_CLK>;
+			clock-names = "apb", "pwm";
+			power-domains = <&cpg>;
+			#pwm-cells = <2>;
+			status = "disabled";
+		};
+
+		pwm10: pwm@a4010500 {
+			compatible = "renesas,r9a09g011-pwm",
+				     "renesas,rzv2m-pwm";
+			reg = <0 0xa4010500 0 0x80>;
+			interrupts = <GIC_SPI 378 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD R9A09G011_CPERI_GRPF_PCLK>,
+				 <&cpg CPG_MOD R9A09G011_PWM10_CLK>;
+			clock-names = "apb", "pwm";
+			power-domains = <&cpg>;
+			#pwm-cells = <2>;
+			status = "disabled";
+		};
+
+		pwm11: pwm@a4010580 {
+			compatible = "renesas,r9a09g011-pwm",
+				     "renesas,rzv2m-pwm";
+			reg = <0 0xa4010580 0 0x80>;
+			interrupts = <GIC_SPI 379 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD R9A09G011_CPERI_GRPF_PCLK>,
+				 <&cpg CPG_MOD R9A09G011_PWM11_CLK>;
+			clock-names = "apb", "pwm";
+			power-domains = <&cpg>;
+			#pwm-cells = <2>;
+			status = "disabled";
+		};
+
+		pwm12: pwm@a4010600 {
+			compatible = "renesas,r9a09g011-pwm",
+				     "renesas,rzv2m-pwm";
+			reg = <0 0xa4010600 0 0x80>;
+			interrupts = <GIC_SPI 380 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD R9A09G011_CPERI_GRPF_PCLK>,
+				 <&cpg CPG_MOD R9A09G011_PWM12_CLK>;
+			clock-names = "apb", "pwm";
+			power-domains = <&cpg>;
+			#pwm-cells = <2>;
+			status = "disabled";
+		};
+
+		pwm13: pwm@a4010680 {
+			compatible = "renesas,r9a09g011-pwm",
+				     "renesas,rzv2m-pwm";
+			reg = <0 0xa4010680 0 0x80>;
+			interrupts = <GIC_SPI 381 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD R9A09G011_CPERI_GRPF_PCLK>,
+				 <&cpg CPG_MOD R9A09G011_PWM13_CLK>;
+			clock-names = "apb", "pwm";
+			power-domains = <&cpg>;
+			#pwm-cells = <2>;
+			status = "disabled";
+		};
+
+		pwm14: pwm@a4010700 {
+			compatible = "renesas,r9a09g011-pwm",
+				     "renesas,rzv2m-pwm";
+			reg = <0 0xa4010700 0 0x80>;
+			interrupts = <GIC_SPI 382 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD R9A09G011_CPERI_GRPF_PCLK>,
+				 <&cpg CPG_MOD R9A09G011_PWM14_CLK>;
+			clock-names = "apb", "pwm";
+			power-domains = <&cpg>;
+			#pwm-cells = <2>;
+			status = "disabled";
+		};
+
 		i2c0: i2c@a4030000 {
 			#address-cells = <1>;
 			#size-cells = <0>;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/5] arm64: dts: renesas: rzv2m evk: Enable pwm
  2022-11-18 13:16 [PATCH 0/5] Add RZ/V2{M, MA} driver support Biju Das
  2022-11-18 13:16 ` [PATCH 2/5] dt-bindings: pwm: Add RZ/V2M PWM binding Biju Das
  2022-11-18 13:16 ` [PATCH 4/5] arm64: dts: renesas: r9a09g011: Add pwm nodes Biju Das
@ 2022-11-18 13:16 ` Biju Das
  2 siblings, 0 replies; 8+ messages in thread
From: Biju Das @ 2022-11-18 13:16 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: Biju Das, Geert Uytterhoeven, Magnus Damm, linux-renesas-soc,
	devicetree, Fabrizio Castro

Enable pwm{8..14} on RZ/V2M EVK.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
 .../boot/dts/renesas/r9a09g011-v2mevk2.dts    | 70 +++++++++++++++++++
 1 file changed, 70 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r9a09g011-v2mevk2.dts b/arch/arm64/boot/dts/renesas/r9a09g011-v2mevk2.dts
index 11e1d51c7c0e..73d7481b468e 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g011-v2mevk2.dts
+++ b/arch/arm64/boot/dts/renesas/r9a09g011-v2mevk2.dts
@@ -78,6 +78,76 @@ i2c2_pins: i2c2 {
 		pinmux = <RZV2M_PORT_PINMUX(3, 8, 2)>, /* SDA */
 			 <RZV2M_PORT_PINMUX(3, 9, 2)>; /* SCL */
 	};
+
+	pwm8_pins: pwm8 {
+		pinmux = <RZV2M_PORT_PINMUX(1, 8, 1)>;  /* PM8 */
+	};
+
+	pwm9_pins: pwm9 {
+		pinmux = <RZV2M_PORT_PINMUX(1, 9, 1)>;  /* PM9 */
+	};
+
+	pwm10_pins: pwm10 {
+		pinmux = <RZV2M_PORT_PINMUX(1, 10, 1)>; /* PM10 */
+	};
+
+	pwm11_pins: pwm11 {
+		pinmux = <RZV2M_PORT_PINMUX(1, 11, 1)>; /* PM11 */
+	};
+
+	pwm12_pins: pwm12 {
+		pinmux = <RZV2M_PORT_PINMUX(1, 12, 1)>; /* PM12 */
+	};
+
+	pwm13_pins: pwm13 {
+		pinmux = <RZV2M_PORT_PINMUX(1, 13, 1)>; /* PM13 */
+	};
+
+	pwm14_pins: pwm14 {
+		pinmux = <RZV2M_PORT_PINMUX(1, 14, 1)>; /* PM14 */
+	};
+};
+
+&pwm8 {
+	pinctrl-0 = <&pwm8_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&pwm9 {
+	pinctrl-0 = <&pwm9_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&pwm10 {
+	pinctrl-0 = <&pwm10_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&pwm11 {
+	pinctrl-0 = <&pwm11_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&pwm12 {
+	pinctrl-0 = <&pwm12_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&pwm13 {
+	pinctrl-0 = <&pwm13_pins>;
+	pinctrl-names = "default";
+	status = "okay";
+};
+
+&pwm14 {
+	pinctrl-0 = <&pwm14_pins>;
+	pinctrl-names = "default";
+	status = "okay";
 };
 
 &uart0 {
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/5] dt-bindings: pwm: Add RZ/V2M PWM binding
  2022-11-18 13:16 ` [PATCH 2/5] dt-bindings: pwm: Add RZ/V2M PWM binding Biju Das
@ 2022-11-22 11:46   ` Krzysztof Kozlowski
  2022-11-22 11:53     ` Biju Das
  2022-11-24  8:43   ` Geert Uytterhoeven
  1 sibling, 1 reply; 8+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-22 11:46 UTC (permalink / raw)
  To: Biju Das, Thierry Reding, Rob Herring, Krzysztof Kozlowski
  Cc: Uwe Kleine-König, linux-pwm, devicetree, Geert Uytterhoeven,
	Fabrizio Castro, linux-renesas-soc

On 18/11/2022 14:16, Biju Das wrote:
> Add device tree bindings for the RZ/V2{M, MA} PWM Timer (PWM).
> 
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

Thank you for your patch. There is something to discuss/improve.

> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +  - power-domains
> +
> +if:
> +  properties:
> +    compatible:
> +      contains:
> +        enum:
> +          - renesas,r9a09g055-pwm
> +then:
> +  required:
> +    - resets
> +
> +allOf:
> +  - $ref: pwm.yaml#

Put the if under allOf:

allOf:
 - $ref...
 - if:
     then:

This allows easier growth.

With above:

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>


Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 2/5] dt-bindings: pwm: Add RZ/V2M PWM binding
  2022-11-22 11:46   ` Krzysztof Kozlowski
@ 2022-11-22 11:53     ` Biju Das
  0 siblings, 0 replies; 8+ messages in thread
From: Biju Das @ 2022-11-22 11:53 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Thierry Reding, Rob Herring,
	Krzysztof Kozlowski
  Cc: Uwe Kleine-König, linux-pwm@vger.kernel.org,
	devicetree@vger.kernel.org, Geert Uytterhoeven, Fabrizio Castro,
	linux-renesas-soc@vger.kernel.org

Hi Krzysztof Kozlowski,

thanks for the feedback.

> Subject: Re: [PATCH 2/5] dt-bindings: pwm: Add RZ/V2M PWM binding
> 
> On 18/11/2022 14:16, Biju Das wrote:
> > Add device tree bindings for the RZ/V2{M, MA} PWM Timer (PWM).
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> 
> Thank you for your patch. There is something to discuss/improve.
> 
> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +  - clocks
> > +  - clock-names
> > +  - power-domains
> > +
> > +if:
> > +  properties:
> > +    compatible:
> > +      contains:
> > +        enum:
> > +          - renesas,r9a09g055-pwm
> > +then:
> > +  required:
> > +    - resets
> > +
> > +allOf:
> > +  - $ref: pwm.yaml#
> 
> Put the if under allOf:
> 
> allOf:
>  - $ref...
>  - if:
>      then:
> 
> This allows easier growth.

OK will send v2, along with feedback for driver patches if any.

Cheers,
Biju

> 
> With above:
> 
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> 
> 
> Best regards,
> Krzysztof


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/5] dt-bindings: pwm: Add RZ/V2M PWM binding
  2022-11-18 13:16 ` [PATCH 2/5] dt-bindings: pwm: Add RZ/V2M PWM binding Biju Das
  2022-11-22 11:46   ` Krzysztof Kozlowski
@ 2022-11-24  8:43   ` Geert Uytterhoeven
  2022-11-24  9:45     ` Biju Das
  1 sibling, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2022-11-24  8:43 UTC (permalink / raw)
  To: Biju Das
  Cc: Thierry Reding, Rob Herring, Krzysztof Kozlowski,
	Uwe Kleine-König, linux-pwm, devicetree, Fabrizio Castro,
	linux-renesas-soc

Hi Biju,

On Fri, Nov 18, 2022 at 2:16 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
> Add device tree bindings for the RZ/V2{M, MA} PWM Timer (PWM).
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>

Thanks for your patch!

> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pwm/renesas,rzv2m-pwm.yaml
> @@ -0,0 +1,98 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/pwm/renesas,rzv2m-pwm.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Renesas RZ/V2{M, MA} PWM Timer (PWM)
> +
> +maintainers:
> +  - Biju Das <biju.das.jz@bp.renesas.com>
> +
> +description: |
> +  The RZ/V2{M, MA} PWM Timer (PWM) composed of 16 channels. It supports the
> +  following functions
> +  * The PWM has 24-bit counters which operate at PWM_CLK (48 MHz).
> +  * The frequency division ratio for internal counter operation is selectable
> +    as PWM_CLK divided by 1, 16, 256, or 2048.
> +  * The period as well as the duty cycle is adjustable.
> +  * The low-level and high-level order of the PWM signals can be inverted.
> +  * The duty cycle of the PWM signal is selectable in the range from 0 to 100%.
> +  * The minimum resolution is 20.83 ns.
> +  * Three interrupt sources: Rising and falling edges of the PWM signal and
> +    clearing of the counter
> +  * Counter operation and the bus interface are asynchronous and both can
> +    operate independently of the magnitude relationship of the respective
> +    clock periods.
> +
> +properties:
> +  compatible:
> +    items:
> +      - enum:
> +          - renesas,r9a09g011-pwm  # RZ/V2M
> +          - renesas,r9a09g055-pwm  # RZ/V2MA
> +      - const: renesas,rzv2m-pwm
> +
> +  reg:
> +    maxItems: 1
> +
> +  '#pwm-cells':
> +    const: 2
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  clocks:
> +    items:
> +      - description: CPU Peripheral Group F APB clock

"APB clock"

PWM0-7] are part of Peripheral Group E, and the block might be
reused on SoCs not using CPU Peripheral Group clock signals.

> +      - description: PWM clock
> +
> +  clock-names:
> +    items:
> +      - const: apb
> +      - const: pwm
> +
> +  power-domains:
> +    maxItems: 1
> +
> +  resets:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +  - interrupts
> +  - clocks
> +  - clock-names
> +  - power-domains
> +
> +if:
> +  properties:
> +    compatible:
> +      contains:
> +        enum:
> +          - renesas,r9a09g055-pwm
> +then:
> +  required:
> +    - resets

I think you should make the resets property required unconditionally.
DT describes hardware, not software policy.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH 2/5] dt-bindings: pwm: Add RZ/V2M PWM binding
  2022-11-24  8:43   ` Geert Uytterhoeven
@ 2022-11-24  9:45     ` Biju Das
  0 siblings, 0 replies; 8+ messages in thread
From: Biju Das @ 2022-11-24  9:45 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Thierry Reding, Rob Herring, Krzysztof Kozlowski,
	Uwe Kleine-König, linux-pwm@vger.kernel.org,
	devicetree@vger.kernel.org, Fabrizio Castro,
	linux-renesas-soc@vger.kernel.org

Hi Geert,

Thanks for the feedback.

> Subject: Re: [PATCH 2/5] dt-bindings: pwm: Add RZ/V2M PWM binding
> 
> Hi Biju,
> 
> On Fri, Nov 18, 2022 at 2:16 PM Biju Das <biju.das.jz@bp.renesas.com>
> wrote:
> > Add device tree bindings for the RZ/V2{M, MA} PWM Timer (PWM).
> >
> > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> 
> Thanks for your patch!
> 
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/pwm/renesas,rzv2m-pwm.yaml
> > @@ -0,0 +1,98 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
> > +---
> > +$id:
> > +
> > +title: Renesas RZ/V2{M, MA} PWM Timer (PWM)
> > +
> > +maintainers:
> > +  - Biju Das <biju.das.jz@bp.renesas.com>
> > +
> > +description: |
> > +  The RZ/V2{M, MA} PWM Timer (PWM) composed of 16 channels. It
> > +supports the
> > +  following functions
> > +  * The PWM has 24-bit counters which operate at PWM_CLK (48 MHz).
> > +  * The frequency division ratio for internal counter operation is
> selectable
> > +    as PWM_CLK divided by 1, 16, 256, or 2048.
> > +  * The period as well as the duty cycle is adjustable.
> > +  * The low-level and high-level order of the PWM signals can be
> inverted.
> > +  * The duty cycle of the PWM signal is selectable in the range from
> 0 to 100%.
> > +  * The minimum resolution is 20.83 ns.
> > +  * Three interrupt sources: Rising and falling edges of the PWM
> signal and
> > +    clearing of the counter
> > +  * Counter operation and the bus interface are asynchronous and both
> can
> > +    operate independently of the magnitude relationship of the
> respective
> > +    clock periods.
> > +
> > +properties:
> > +  compatible:
> > +    items:
> > +      - enum:
> > +          - renesas,r9a09g011-pwm  # RZ/V2M
> > +          - renesas,r9a09g055-pwm  # RZ/V2MA
> > +      - const: renesas,rzv2m-pwm
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  '#pwm-cells':
> > +    const: 2
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  clocks:
> > +    items:
> > +      - description: CPU Peripheral Group F APB clock
> 
> "APB clock"
Agreed.

> 
> PWM0-7] are part of Peripheral Group E, and the block might be reused on
> SoCs not using CPU Peripheral Group clock signals.
> 
> > +      - description: PWM clock
> > +
> > +  clock-names:
> > +    items:
> > +      - const: apb
> > +      - const: pwm
> > +
> > +  power-domains:
> > +    maxItems: 1
> > +
> > +  resets:
> > +    maxItems: 1
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - interrupts
> > +  - clocks
> > +  - clock-names
> > +  - power-domains
> > +
> > +if:
> > +  properties:
> > +    compatible:
> > +      contains:
> > +        enum:
> > +          - renesas,r9a09g055-pwm
> > +then:
> > +  required:
> > +    - resets
> 
> I think you should make the resets property required unconditionally.
> DT describes hardware, not software policy.

OK will send V2 with these changes.

Cheers,
Biju

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-11-24  9:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-18 13:16 [PATCH 0/5] Add RZ/V2{M, MA} driver support Biju Das
2022-11-18 13:16 ` [PATCH 2/5] dt-bindings: pwm: Add RZ/V2M PWM binding Biju Das
2022-11-22 11:46   ` Krzysztof Kozlowski
2022-11-22 11:53     ` Biju Das
2022-11-24  8:43   ` Geert Uytterhoeven
2022-11-24  9:45     ` Biju Das
2022-11-18 13:16 ` [PATCH 4/5] arm64: dts: renesas: r9a09g011: Add pwm nodes Biju Das
2022-11-18 13:16 ` [PATCH 5/5] arm64: dts: renesas: rzv2m evk: Enable pwm Biju Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox