* [PATCH] dt-bindings: pwm: st,pwm: convert to DT schema
@ 2026-06-13 7:04 Charan Pedumuru
2026-06-13 7:13 ` sashiko-bot
2026-06-15 6:34 ` Uwe Kleine-König
0 siblings, 2 replies; 5+ messages in thread
From: Charan Pedumuru @ 2026-06-13 7:04 UTC (permalink / raw)
To: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, Pal Singh
Cc: linux-pwm, devicetree, linux-kernel, Charan Pedumuru
Convert STMicroelectronics STiH41x PWM/Capture controller binding
to DT schema.
Signed-off-by: Charan Pedumuru <charan.pedumuru@gmail.com>
---
Documentation/devicetree/bindings/pwm/pwm-st.txt | 43 -----------
Documentation/devicetree/bindings/pwm/st,pwm.yaml | 90 +++++++++++++++++++++++
2 files changed, 90 insertions(+), 43 deletions(-)
diff --git a/Documentation/devicetree/bindings/pwm/pwm-st.txt b/Documentation/devicetree/bindings/pwm/pwm-st.txt
deleted file mode 100644
index 19fce774cafa..000000000000
--- a/Documentation/devicetree/bindings/pwm/pwm-st.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-STMicroelectronics PWM driver bindings
---------------------------------------
-
-Required parameters:
-- compatible : "st,pwm"
-- #pwm-cells : Number of cells used to specify a PWM. First cell
- specifies the per-chip index of the PWM to use and the
- second cell is the period in nanoseconds - fixed to 2
- for STiH41x.
-- reg : Physical base address and length of the controller's
- registers.
-- pinctrl-names: Set to "default".
-- pinctrl-0: List of phandles pointing to pin configuration nodes
- for PWM module.
- For Pinctrl properties, please refer to [1].
-- clock-names: Valid entries are "pwm" and/or "capture".
-- clocks: phandle of the clock used by the PWM module.
- For Clk properties, please refer to [2].
-- interrupts: IRQ for the Capture device
-
-Optional properties:
-- st,pwm-num-chan: Number of available PWM channels. Default is 0.
-- st,capture-num-chan: Number of available Capture channels. Default is 0.
-
-[1] Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
-[2] Documentation/devicetree/bindings/clock/clock-bindings.txt
-
-Example:
-
-pwm1: pwm@fe510000 {
- compatible = "st,pwm";
- reg = <0xfe510000 0x68>;
- #pwm-cells = <2>;
- pinctrl-names = "default";
- pinctrl-0 = <&pinctrl_pwm1_chan0_default
- &pinctrl_pwm1_chan1_default
- &pinctrl_pwm1_chan2_default
- &pinctrl_pwm1_chan3_default>;
- clocks = <&clk_sysin>;
- clock-names = "pwm";
- st,pwm-num-chan = <4>;
- st,capture-num-chan = <2>;
-};
diff --git a/Documentation/devicetree/bindings/pwm/st,pwm.yaml b/Documentation/devicetree/bindings/pwm/st,pwm.yaml
new file mode 100644
index 000000000000..2c10f54b5caf
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/st,pwm.yaml
@@ -0,0 +1,90 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/st,pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: STMicroelectronics STiH41x PWM/Capture controller
+
+maintainers:
+ - Ajit Pal Singh <ajitpal.singh@st.com>
+
+description:
+ The STiH41x PWM controller supports both PWM output and input capture
+ functionality. It provides multiple PWM output channels for generating
+ variable duty-cycle waveforms, and multiple input capture channels for
+ measuring external signal periods and pulse widths. PWM output channels
+ and input capture channels are configured independently via
+ st,pwm-num-chan and st,capture-num-chan respectively.
+
+allOf:
+ - $ref: pwm.yaml#
+
+properties:
+ compatible:
+ const: st,pwm
+
+ reg:
+ maxItems: 1
+
+ "#pwm-cells":
+ const: 2
+
+ pinctrl-names:
+ const: default
+
+ clock-names:
+ items:
+ enum: [pwm, capture]
+ minItems: 1
+ maxItems: 2
+
+ clocks:
+ minItems: 1
+ maxItems: 2
+
+ interrupts:
+ description: IRQ line for the capture device.
+ maxItems: 1
+
+ st,pwm-num-chan:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: Number of available PWM output channels.
+ minimum: 0
+ maximum: 4
+ default: 0
+
+ st,capture-num-chan:
+ $ref: /schemas/types.yaml#/definitions/uint32
+ description: Number of available input capture channels.
+ minimum: 0
+ maximum: 4
+ default: 0
+
+required:
+ - reg
+ - compatible
+ - "#pwm-cells"
+ - pinctrl-names
+ - clock-names
+ - clocks
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ pwm@fe510000 {
+ compatible = "st,pwm";
+ reg = <0xfe510000 0x68>;
+ #pwm-cells = <2>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_pwm1_chan0_default
+ &pinctrl_pwm1_chan1_default
+ &pinctrl_pwm1_chan2_default
+ &pinctrl_pwm1_chan3_default>;
+ clocks = <&clk_sysin>;
+ clock-names = "pwm";
+ st,pwm-num-chan = <4>;
+ st,capture-num-chan = <2>;
+ };
+...
---
base-commit: c425609d6ac4012c8bbf01ec2e10e801b1923a7b
change-id: 20260613-st-pwm-1feade6cfea3
Best regards,
--
Charan Pedumuru <charan.pedumuru@gmail.com>
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] dt-bindings: pwm: st,pwm: convert to DT schema
2026-06-13 7:04 [PATCH] dt-bindings: pwm: st,pwm: convert to DT schema Charan Pedumuru
@ 2026-06-13 7:13 ` sashiko-bot
2026-06-13 7:20 ` Charan Pedumuru
2026-06-15 6:34 ` Uwe Kleine-König
1 sibling, 1 reply; 5+ messages in thread
From: sashiko-bot @ 2026-06-13 7:13 UTC (permalink / raw)
To: Charan Pedumuru; +Cc: conor+dt, devicetree, robh
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The `interrupts` property is unconditionally required by the driver but omitted from the YAML schema's required list.
--
commit b16a62dff3236ec8b123a99775f6c90dbfd9912f
Author: Charan Pedumuru <charan.pedumuru@gmail.com>
dt-bindings: pwm: st,pwm: convert to DT schema
Convert STMicroelectronics STiH41x PWM/Capture controller binding
to DT schema.
> diff --git a/Documentation/devicetree/bindings/pwm/pwm-st.txt b/Documentation/devicetree/bindings/pwm/pwm-st.txt
> deleted file mode 100644
> index 19fce774cafad..0000000000000
> --- a/Documentation/devicetree/bindings/pwm/pwm-st.txt
> +++ /dev/null
[ ... ]
> -Required parameters:
[ ... ]
> -- interrupts: IRQ for the Capture device
[ ... ]
> diff --git a/Documentation/devicetree/bindings/pwm/st,pwm.yaml b/Documentation/devicetree/bindings/pwm/st,pwm.yaml
> new file mode 100644
> index 0000000000000..2c10f54b5caf3
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pwm/st,pwm.yaml
[ ... ]
> +required:
> + - reg
> + - compatible
> + - "#pwm-cells"
> + - pinctrl-names
> + - clock-names
> + - clocks
[Severity: Medium]
Should interrupts be included in this required list?
The original text binding listed interrupts under the required parameters,
and the driver unconditionally requests it during probe:
drivers/pwm/pwm-sti.c:sti_pwm_probe() {
...
irq = platform_get_irq(pdev, 0);
if (irq < 0)
return irq;
ret = devm_request_irq(&pdev->dev, irq, sti_pwm_interrupt, 0,
pdev->name, pc);
...
}
Without interrupts in the required list, incomplete device trees will pass
schema validation but fail deterministically at runtime.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260613-st-pwm-v1-1-458c2c89709a@gmail.com?part=1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dt-bindings: pwm: st,pwm: convert to DT schema
2026-06-13 7:13 ` sashiko-bot
@ 2026-06-13 7:20 ` Charan Pedumuru
2026-06-13 19:02 ` Krzysztof Kozlowski
0 siblings, 1 reply; 5+ messages in thread
From: Charan Pedumuru @ 2026-06-13 7:20 UTC (permalink / raw)
To: sashiko-reviews; +Cc: conor+dt, devicetree, robh
On 13-06-2026 12:43, sashiko-bot@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> - [Medium] The `interrupts` property is unconditionally required by the driver but omitted from the YAML schema's required list.
> --
>
> commit b16a62dff3236ec8b123a99775f6c90dbfd9912f
> Author: Charan Pedumuru <charan.pedumuru@gmail.com>
>
> dt-bindings: pwm: st,pwm: convert to DT schema
>
> Convert STMicroelectronics STiH41x PWM/Capture controller binding
> to DT schema.
>
>> diff --git a/Documentation/devicetree/bindings/pwm/pwm-st.txt b/Documentation/devicetree/bindings/pwm/pwm-st.txt
>> deleted file mode 100644
>> index 19fce774cafad..0000000000000
>> --- a/Documentation/devicetree/bindings/pwm/pwm-st.txt
>> +++ /dev/null
>
> [ ... ]
>
>> -Required parameters:
>
> [ ... ]
>
>> -- interrupts: IRQ for the Capture device
Okay, I will define and add interrupts to the required.
>
> [ ... ]
>
>> diff --git a/Documentation/devicetree/bindings/pwm/st,pwm.yaml b/Documentation/devicetree/bindings/pwm/st,pwm.yaml
>> new file mode 100644
>> index 0000000000000..2c10f54b5caf3
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/pwm/st,pwm.yaml
>
> [ ... ]
>
>> +required:
>> + - reg
>> + - compatible
>> + - "#pwm-cells"
>> + - pinctrl-names
>> + - clock-names
>> + - clocks
>
> [Severity: Medium]
> Should interrupts be included in this required list?
>
> The original text binding listed interrupts under the required parameters,
> and the driver unconditionally requests it during probe:
>
> drivers/pwm/pwm-sti.c:sti_pwm_probe() {
> ...
> irq = platform_get_irq(pdev, 0);
> if (irq < 0)
> return irq;
>
> ret = devm_request_irq(&pdev->dev, irq, sti_pwm_interrupt, 0,
> pdev->name, pc);
> ...
> }
>
> Without interrupts in the required list, incomplete device trees will pass
> schema validation but fail deterministically at runtime.
Okay. I will add interrupts to my next revision.
>
--
Best Regards,
Charan.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dt-bindings: pwm: st,pwm: convert to DT schema
2026-06-13 7:20 ` Charan Pedumuru
@ 2026-06-13 19:02 ` Krzysztof Kozlowski
0 siblings, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2026-06-13 19:02 UTC (permalink / raw)
To: Charan Pedumuru; +Cc: sashiko-reviews, conor+dt, devicetree, robh
On Sat, Jun 13, 2026 at 12:50:54PM +0530, Charan Pedumuru wrote:
>
>
> On 13-06-2026 12:43, sashiko-bot@kernel.org wrote:
> > Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
> > - [Medium] The `interrupts` property is unconditionally required by the driver but omitted from the YAML schema's required list.
interrupts were required by old binding and you should document in
commit msg all changes done to the binding with a reason.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] dt-bindings: pwm: st,pwm: convert to DT schema
2026-06-13 7:04 [PATCH] dt-bindings: pwm: st,pwm: convert to DT schema Charan Pedumuru
2026-06-13 7:13 ` sashiko-bot
@ 2026-06-15 6:34 ` Uwe Kleine-König
1 sibling, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2026-06-15 6:34 UTC (permalink / raw)
To: Charan Pedumuru
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Pal Singh,
linux-pwm, devicetree, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 598 bytes --]
Hello,
On Sat, Jun 13, 2026 at 07:04:11AM +0000, Charan Pedumuru wrote:
> Convert STMicroelectronics STiH41x PWM/Capture controller binding
> to DT schema.
>
> Signed-off-by: Charan Pedumuru <charan.pedumuru@gmail.com>
FTR: sashiko found a relevant issue in this patch, sent a mail about it,
but not to the list. It's about the old binding requiring `interrupts`
which isn't the case in the new proposed one.
Find the full message at
https://sashiko.dev/#/message/20260613071327.BE3101F000E9%40smtp.kernel.org.
So I marked this patch as changes requested.
Best reagrds
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-06-15 6:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-13 7:04 [PATCH] dt-bindings: pwm: st,pwm: convert to DT schema Charan Pedumuru
2026-06-13 7:13 ` sashiko-bot
2026-06-13 7:20 ` Charan Pedumuru
2026-06-13 19:02 ` Krzysztof Kozlowski
2026-06-15 6:34 ` Uwe Kleine-König
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox