* [PATCH] dt-bindings: pwm: Convert lpc32xx-pwm.txt to YAML schema
@ 2025-03-11 12:57 Purva Yeshi
2025-03-11 13:22 ` Krzysztof Kozlowski
0 siblings, 1 reply; 4+ messages in thread
From: Purva Yeshi @ 2025-03-11 12:57 UTC (permalink / raw)
To: ukleinek, robh, krzk+dt, conor+dt, vz, piotr.wojtaszczyk
Cc: linux-pwm, devicetree, linux-arm-kernel, linux-kernel,
Purva Yeshi
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 2213 bytes --]
Convert the existing `lpc32xx-pwm.txt` bindings documentation into a
YAML schema (`lpc32xx-pwm.yaml`).
Changes:
Add SPDX license identifier `(GPL-2.0-only OR BSD-2-Clause)`.
Define `$id` and `$schema` fields for proper schema validation.
Set `title` to describe the LPC32XX PWM controller.
Add maintainers as per `scripts/get_maintainer.pl` output.
Reference `pwm.yaml#` in `allOf` to inherit common PWM properties.
Define properties:
Restrict `compatible` to `"nxp,lpc3220-pwm"` using `const`.
Limit `reg` to `maxItems: 1` to ensure a single register range.
Set `"#pwm-cells"` to `const: 3` for expected PWM cell properties.
Mark `compatible` and `reg` as required properties.
Set `unevaluatedProperties: false` to enforce strict validation.
Validate the YAML schema using dt-validate and yamllint.
Signed-off-by: Purva Yeshi <purvayeshi550@gmail.com>
---
.../devicetree/bindings/pwm/lpc32xx-pwm.yaml | 45 +++++++++++++++++++
1 file changed, 45 insertions(+)
create mode 100644 Documentation/devicetree/bindings/pwm/lpc32xx-pwm.yaml
diff --git a/Documentation/devicetree/bindings/pwm/lpc32xx-pwm.yaml b/Documentation/devicetree/bindings/pwm/lpc32xx-pwm.yaml
new file mode 100644
index 000000000..3e41cd291
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/lpc32xx-pwm.yaml
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/nxp,lpc32xx-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: LPC32XX PWM controller
+
+maintainers:
+ - "Uwe Kleine-König <ukleinek@kernel.org>"
+ - "Vladimir Zapolskiy <vz@mleia.com>"
+ - "Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>"
+
+allOf:
+ - $ref: pwm.yaml#
+
+properties:
+ compatible:
+ const: nxp,lpc3220-pwm
+
+ reg:
+ maxItems: 1
+
+ "#pwm-cells":
+ const: 3
+
+required:
+ - compatible
+ - reg
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ pwm@4005c000 {
+ compatible = "nxp,lpc3220-pwm";
+ reg = <0x4005c000 0x4>;
+ #pwm-cells = <3>;
+ };
+ - |
+ pwm@4005c004 {
+ compatible = "nxp,lpc3220-pwm";
+ reg = <0x4005c004 0x4>;
+ #pwm-cells = <3>;
+ };
--
2.34.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] dt-bindings: pwm: Convert lpc32xx-pwm.txt to YAML schema
2025-03-11 12:57 [PATCH] dt-bindings: pwm: Convert lpc32xx-pwm.txt to YAML schema Purva Yeshi
@ 2025-03-11 13:22 ` Krzysztof Kozlowski
2025-03-11 14:55 ` Purva Yeshi
0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2025-03-11 13:22 UTC (permalink / raw)
To: Purva Yeshi, ukleinek, robh, krzk+dt, conor+dt, vz,
piotr.wojtaszczyk
Cc: linux-pwm, devicetree, linux-arm-kernel, linux-kernel
On 11/03/2025 13:57, Purva Yeshi wrote:
> Convert the existing `lpc32xx-pwm.txt` bindings documentation into a
> YAML schema (`lpc32xx-pwm.yaml`).
>
> Changes:
>
> Add SPDX license identifier `(GPL-2.0-only OR BSD-2-Clause)`.
That's not a change in the binding.
> Define `$id` and `$schema` fields for proper schema validation.
> Set `title` to describe the LPC32XX PWM controller.
Neither these.
> Add maintainers as per `scripts/get_maintainer.pl` output.
These should not be subsystem maintainers.
> Reference `pwm.yaml#` in `allOf` to inherit common PWM properties.
Not a change to the binding.
>
> Define properties:
> Restrict `compatible` to `"nxp,lpc3220-pwm"` using `const`.
> Limit `reg` to `maxItems: 1` to ensure a single register range.
> Set `"#pwm-cells"` to `const: 3` for expected PWM cell properties.
>
> Mark `compatible` and `reg` as required properties.
So it wasn't before? What are you implying here?
> Set `unevaluatedProperties: false` to enforce strict validation.
>
> Validate the YAML schema using dt-validate and yamllint.
None of above is suitable for commit msg.
>
> Signed-off-by: Purva Yeshi <purvayeshi550@gmail.com>
> ---
> .../devicetree/bindings/pwm/lpc32xx-pwm.yaml | 45 +++++++++++++++++++
> 1 file changed, 45 insertions(+)
Where is the conversion?
> create mode 100644 Documentation/devicetree/bindings/pwm/lpc32xx-pwm.yaml
>
> diff --git a/Documentation/devicetree/bindings/pwm/lpc32xx-pwm.yaml b/Documentation/devicetree/bindings/pwm/lpc32xx-pwm.yaml
> new file mode 100644
> index 000000000..3e41cd291
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pwm/lpc32xx-pwm.yaml
> @@ -0,0 +1,45 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/pwm/nxp,lpc32xx-pwm.yaml#
Filename matching compatible.
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: LPC32XX PWM controller
> +
> +maintainers:
> + - "Uwe Kleine-König <ukleinek@kernel.org>"
> + - "Vladimir Zapolskiy <vz@mleia.com>"
> + - "Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>"
Look at other bindings - none of them use quotes.
> +
> +allOf:
> + - $ref: pwm.yaml#
> +
> +properties:
> + compatible:
> + const: nxp,lpc3220-pwm
> +
> + reg:
> + maxItems: 1
> +
> + "#pwm-cells":
> + const: 3
> +
> +required:
> + - compatible
> + - reg
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + pwm@4005c000 {
> + compatible = "nxp,lpc3220-pwm";
> + reg = <0x4005c000 0x4>;
> + #pwm-cells = <3>;
> + };
> + - |
> + pwm@4005c004 {
> + compatible = "nxp,lpc3220-pwm";
One example is enough.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dt-bindings: pwm: Convert lpc32xx-pwm.txt to YAML schema
2025-03-11 13:22 ` Krzysztof Kozlowski
@ 2025-03-11 14:55 ` Purva Yeshi
2025-03-11 15:14 ` Krzysztof Kozlowski
0 siblings, 1 reply; 4+ messages in thread
From: Purva Yeshi @ 2025-03-11 14:55 UTC (permalink / raw)
To: Krzysztof Kozlowski, ukleinek, robh, krzk+dt, conor+dt, vz,
piotr.wojtaszczyk
Cc: linux-pwm, devicetree, linux-arm-kernel, linux-kernel
On 11/03/25 18:52, Krzysztof Kozlowski wrote:
> On 11/03/2025 13:57, Purva Yeshi wrote:
>> Convert the existing `lpc32xx-pwm.txt` bindings documentation into a
>> YAML schema (`lpc32xx-pwm.yaml`).
>>
>> Changes:
>>
>> Add SPDX license identifier `(GPL-2.0-only OR BSD-2-Clause)`.
>
> That's not a change in the binding.
>
>> Define `$id` and `$schema` fields for proper schema validation.
>> Set `title` to describe the LPC32XX PWM controller.
>
> Neither these.
>
>> Add maintainers as per `scripts/get_maintainer.pl` output.
>
> These should not be subsystem maintainers.
I have removed the subsystem maintainers and included only relevant ones:
Vladimir Zapolskiy <vz@mleia.com>
Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>
>
>> Reference `pwm.yaml#` in `allOf` to inherit common PWM properties.
>
> Not a change to the binding.
>
>>
>> Define properties:
>> Restrict `compatible` to `"nxp,lpc3220-pwm"` using `const`.
>> Limit `reg` to `maxItems: 1` to ensure a single register range.
>> Set `"#pwm-cells"` to `const: 3` for expected PWM cell properties.
>>
>> Mark `compatible` and `reg` as required properties.
>
> So it wasn't before? What are you implying here?
The compatible and reg properties were already present in the .txt file,
but in a different format. I initially kept the commit message for them
but have now removed it.
>
>> Set `unevaluatedProperties: false` to enforce strict validation.
>>
>> Validate the YAML schema using dt-validate and yamllint.
>
> None of above is suitable for commit msg.
I have removed all commit message parts you mentioned.
>
>>
>> Signed-off-by: Purva Yeshi <purvayeshi550@gmail.com>
>> ---
>> .../devicetree/bindings/pwm/lpc32xx-pwm.yaml | 45 +++++++++++++++++++
>> 1 file changed, 45 insertions(+)
>
> Where is the conversion?
Apologies for the confusion. I missed removing lpc32xx-pwm.txt. I'll
delete it in the next version to properly reflect the conversion.
>
>> create mode 100644 Documentation/devicetree/bindings/pwm/lpc32xx-pwm.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/pwm/lpc32xx-pwm.yaml b/Documentation/devicetree/bindings/pwm/lpc32xx-pwm.yaml
>> new file mode 100644
>> index 000000000..3e41cd291
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/pwm/lpc32xx-pwm.yaml
>> @@ -0,0 +1,45 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/pwm/nxp,lpc32xx-pwm.yaml#
>
> Filename matching compatible.
In the lpc32xx-pwm.txt file, the compatible property was defined as
"nxp,lpc3220-pwm", so I have kept it the same. To ensure consistency
between the filename and compatible, should I rename the file to
nxp,lpc3220-pwm.yaml?
>
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: LPC32XX PWM controller
>> +
>> +maintainers:
>> + - "Uwe Kleine-König <ukleinek@kernel.org>"
>> + - "Vladimir Zapolskiy <vz@mleia.com>"
>> + - "Piotr Wojtaszczyk <piotr.wojtaszczyk@timesys.com>"
>
> Look at other bindings - none of them use quotes.
>
>> +
>> +allOf:
>> + - $ref: pwm.yaml#
>> +
>> +properties:
>> + compatible:
>> + const: nxp,lpc3220-pwm
>> +
>> + reg:
>> + maxItems: 1
>> +
>> + "#pwm-cells":
>> + const: 3
>> +
>> +required:
>> + - compatible
>> + - reg
>> +
>> +unevaluatedProperties: false
>> +
>> +examples:
>> + - |
>> + pwm@4005c000 {
>> + compatible = "nxp,lpc3220-pwm";
>> + reg = <0x4005c000 0x4>;
>> + #pwm-cells = <3>;
>> + };
>> + - |
>> + pwm@4005c004 {
>> + compatible = "nxp,lpc3220-pwm";
>
> One example is enough.
Okay. I'll remove the second example and keep only one in the next version.
>
>
>
> Best regards,
> Krzysztof
Best regards,
Purva Yeshi
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] dt-bindings: pwm: Convert lpc32xx-pwm.txt to YAML schema
2025-03-11 14:55 ` Purva Yeshi
@ 2025-03-11 15:14 ` Krzysztof Kozlowski
0 siblings, 0 replies; 4+ messages in thread
From: Krzysztof Kozlowski @ 2025-03-11 15:14 UTC (permalink / raw)
To: Purva Yeshi, ukleinek, robh, krzk+dt, conor+dt, vz,
piotr.wojtaszczyk
Cc: linux-pwm, devicetree, linux-arm-kernel, linux-kernel
On 11/03/2025 15:55, Purva Yeshi wrote:
>>>
>>> Define properties:
>>> Restrict `compatible` to `"nxp,lpc3220-pwm"` using `const`.
>>> Limit `reg` to `maxItems: 1` to ensure a single register range.
>>> Set `"#pwm-cells"` to `const: 3` for expected PWM cell properties.
>>>
>>> Mark `compatible` and `reg` as required properties.
>>
>> So it wasn't before? What are you implying here?
>
> The compatible and reg properties were already present in the .txt file,
> but in a different format. I initially kept the commit message for them
> but have now removed it.
What does it mean "different format"?
...
>>>
>>> create mode 100644 Documentation/devicetree/bindings/pwm/lpc32xx-pwm.yaml
>>>
>>> diff --git a/Documentation/devicetree/bindings/pwm/lpc32xx-pwm.yaml b/Documentation/devicetree/bindings/pwm/lpc32xx-pwm.yaml
>>> new file mode 100644
>>> index 000000000..3e41cd291
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/pwm/lpc32xx-pwm.yaml
>>> @@ -0,0 +1,45 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/pwm/nxp,lpc32xx-pwm.yaml#
>>
>> Filename matching compatible.
>
> In the lpc32xx-pwm.txt file, the compatible property was defined as
> "nxp,lpc3220-pwm", so I have kept it the same. To ensure consistency
> between the filename and compatible, should I rename the file to
> nxp,lpc3220-pwm.yaml?
Use whatever is there in the compatible property as the filename.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-03-11 15:15 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-11 12:57 [PATCH] dt-bindings: pwm: Convert lpc32xx-pwm.txt to YAML schema Purva Yeshi
2025-03-11 13:22 ` Krzysztof Kozlowski
2025-03-11 14:55 ` Purva Yeshi
2025-03-11 15:14 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).