devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: rtc: mcp795: convert to YAML
@ 2023-09-06 10:23 Javier Carrasco
  2023-09-06 10:42 ` Krzysztof Kozlowski
  2023-09-06 11:31 ` Rob Herring
  0 siblings, 2 replies; 4+ messages in thread
From: Javier Carrasco @ 2023-09-06 10:23 UTC (permalink / raw)
  To: Alessandro Zummo, Alexandre Belloni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Emil Bartczak, Josef Gajdusek
  Cc: linux-rtc, devicetree, linux-kernel, Javier Carrasco

Convert the MCP795 bindings from text to YAML format to support bindings
validation.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
---
YAML is the preferred format for dt-bindings, which allows validation.
---
 .../devicetree/bindings/rtc/maxim,mcp795.txt       | 11 -------
 .../devicetree/bindings/rtc/maxim,mcp795.yaml      | 35 ++++++++++++++++++++++
 2 files changed, 35 insertions(+), 11 deletions(-)

diff --git a/Documentation/devicetree/bindings/rtc/maxim,mcp795.txt b/Documentation/devicetree/bindings/rtc/maxim,mcp795.txt
deleted file mode 100644
index a59fdd8c236d..000000000000
--- a/Documentation/devicetree/bindings/rtc/maxim,mcp795.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-* Maxim MCP795		SPI Serial Real-Time Clock
-
-Required properties:
-- compatible: Should contain "maxim,mcp795".
-- reg: SPI address for chip
-
-Example:
-	mcp795: rtc@0 {
-		compatible = "maxim,mcp795";
-		reg = <0>;
-	};
diff --git a/Documentation/devicetree/bindings/rtc/maxim,mcp795.yaml b/Documentation/devicetree/bindings/rtc/maxim,mcp795.yaml
new file mode 100644
index 000000000000..77e465747d43
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/maxim,mcp795.yaml
@@ -0,0 +1,35 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/maxim,mcp795.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Maxim MCP795 SPI Serial Real Time Clock
+
+allOf:
+  - $ref: rtc.yaml#
+
+maintainers:
+  - Josef Gajdusek <atx@atx.name>
+
+properties:
+  compatible:
+    enum:
+      - maxim,mcp795
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    rtc@0 {
+        compatible = "maxim,mcp795";
+        reg = <0>;
+    };
+...

---
base-commit: 2dde18cd1d8fac735875f2e4987f11817cc0bc2c
change-id: 20230906-topic-rtc_mcp795_yaml-11058e99ddad

Best regards,
-- 
Javier Carrasco <javier.carrasco.cruz@gmail.com>


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

* Re: [PATCH] dt-bindings: rtc: mcp795: convert to YAML
  2023-09-06 10:23 [PATCH] dt-bindings: rtc: mcp795: convert to YAML Javier Carrasco
@ 2023-09-06 10:42 ` Krzysztof Kozlowski
  2023-09-06 11:48   ` Javier Carrasco
  2023-09-06 11:31 ` Rob Herring
  1 sibling, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2023-09-06 10:42 UTC (permalink / raw)
  To: Javier Carrasco, Alessandro Zummo, Alexandre Belloni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Emil Bartczak, Josef Gajdusek
  Cc: linux-rtc, devicetree, linux-kernel

On 06/09/2023 12:23, Javier Carrasco wrote:
> Convert the MCP795 bindings from text to YAML format to support bindings
> validation.
> 
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
> ---
> YAML is the preferred format for dt-bindings, which allows validation.
> ---
>  .../devicetree/bindings/rtc/maxim,mcp795.txt       | 11 -------
>  .../devicetree/bindings/rtc/maxim,mcp795.yaml      | 35 ++++++++++++++++++++++
>  2 files changed, 35 insertions(+), 11 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/rtc/maxim,mcp795.txt b/Documentation/devicetree/bindings/rtc/maxim,mcp795.txt
> deleted file mode 100644
> index a59fdd8c236d..000000000000
> --- a/Documentation/devicetree/bindings/rtc/maxim,mcp795.txt
> +++ /dev/null
> @@ -1,11 +0,0 @@
> -* Maxim MCP795		SPI Serial Real-Time Clock
> -
> -Required properties:
> -- compatible: Should contain "maxim,mcp795".
> -- reg: SPI address for chip
> -
> -Example:
> -	mcp795: rtc@0 {
> -		compatible = "maxim,mcp795";
> -		reg = <0>;
> -	};
> diff --git a/Documentation/devicetree/bindings/rtc/maxim,mcp795.yaml b/Documentation/devicetree/bindings/rtc/maxim,mcp795.yaml
> new file mode 100644
> index 000000000000..77e465747d43
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/maxim,mcp795.yaml
> @@ -0,0 +1,35 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/rtc/maxim,mcp795.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Maxim MCP795 SPI Serial Real Time Clock
> +
> +allOf:
> +  - $ref: rtc.yaml#

Nit: By convention, this goes after maintainers/description.

> +
> +maintainers:
> +  - Josef Gajdusek <atx@atx.name>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - maxim,mcp795
> +
> +  reg:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false

This should be unevaluatedProperties:false, so you allow other common
RTC properties. But then, it is even smaller than trivial RTC devices, so:
1. What about interrupts? No interrupt line?
2. If there is interrupt line, just add it to trivial-rtc. Otherwise,
it's fine here with changes above.

Best regards,
Krzysztof


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

* Re: [PATCH] dt-bindings: rtc: mcp795: convert to YAML
  2023-09-06 10:23 [PATCH] dt-bindings: rtc: mcp795: convert to YAML Javier Carrasco
  2023-09-06 10:42 ` Krzysztof Kozlowski
@ 2023-09-06 11:31 ` Rob Herring
  1 sibling, 0 replies; 4+ messages in thread
From: Rob Herring @ 2023-09-06 11:31 UTC (permalink / raw)
  To: Javier Carrasco
  Cc: Emil Bartczak, linux-rtc, Krzysztof Kozlowski, Alexandre Belloni,
	Conor Dooley, Josef Gajdusek, linux-kernel, Rob Herring,
	Alessandro Zummo, devicetree


On Wed, 06 Sep 2023 12:23:10 +0200, Javier Carrasco wrote:
> Convert the MCP795 bindings from text to YAML format to support bindings
> validation.
> 
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
> ---
> YAML is the preferred format for dt-bindings, which allows validation.
> ---
>  .../devicetree/bindings/rtc/maxim,mcp795.txt       | 11 -------
>  .../devicetree/bindings/rtc/maxim,mcp795.yaml      | 35 ++++++++++++++++++++++
>  2 files changed, 35 insertions(+), 11 deletions(-)
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/rtc/maxim,mcp795.example.dts:20.13-23: Warning (reg_format): /example-0/rtc@0:reg: property has invalid length (4 bytes) (#address-cells == 1, #size-cells == 1)
Documentation/devicetree/bindings/rtc/maxim,mcp795.example.dtb: Warning (pci_device_reg): Failed prerequisite 'reg_format'
Documentation/devicetree/bindings/rtc/maxim,mcp795.example.dtb: Warning (pci_device_bus_num): Failed prerequisite 'reg_format'
Documentation/devicetree/bindings/rtc/maxim,mcp795.example.dtb: Warning (simple_bus_reg): Failed prerequisite 'reg_format'
Documentation/devicetree/bindings/rtc/maxim,mcp795.example.dtb: Warning (i2c_bus_reg): Failed prerequisite 'reg_format'
Documentation/devicetree/bindings/rtc/maxim,mcp795.example.dtb: Warning (spi_bus_reg): Failed prerequisite 'reg_format'

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20230906-topic-rtc_mcp795_yaml-v1-1-de75c377b5b0@gmail.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.


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

* Re: [PATCH] dt-bindings: rtc: mcp795: convert to YAML
  2023-09-06 10:42 ` Krzysztof Kozlowski
@ 2023-09-06 11:48   ` Javier Carrasco
  0 siblings, 0 replies; 4+ messages in thread
From: Javier Carrasco @ 2023-09-06 11:48 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Javier Carrasco, Alessandro Zummo,
	Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Emil Bartczak, Josef Gajdusek
  Cc: linux-rtc, devicetree, linux-kernel

Hi Krzysztof,

On 06.09.23 12:42, Krzysztof Kozlowski wrote:
> On 06/09/2023 12:23, Javier Carrasco wrote:
>> Convert the MCP795 bindings from text to YAML format to support bindings
>> validation.
>>
>> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
>> ---
>> YAML is the preferred format for dt-bindings, which allows validation.
>> ---
>>  .../devicetree/bindings/rtc/maxim,mcp795.txt       | 11 -------
>>  .../devicetree/bindings/rtc/maxim,mcp795.yaml      | 35 ++++++++++++++++++++++
>>  2 files changed, 35 insertions(+), 11 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/rtc/maxim,mcp795.txt b/Documentation/devicetree/bindings/rtc/maxim,mcp795.txt
>> deleted file mode 100644
>> index a59fdd8c236d..000000000000
>> --- a/Documentation/devicetree/bindings/rtc/maxim,mcp795.txt
>> +++ /dev/null
>> @@ -1,11 +0,0 @@
>> -* Maxim MCP795		SPI Serial Real-Time Clock
>> -
>> -Required properties:
>> -- compatible: Should contain "maxim,mcp795".
>> -- reg: SPI address for chip
>> -
>> -Example:
>> -	mcp795: rtc@0 {
>> -		compatible = "maxim,mcp795";
>> -		reg = <0>;
>> -	};
>> diff --git a/Documentation/devicetree/bindings/rtc/maxim,mcp795.yaml b/Documentation/devicetree/bindings/rtc/maxim,mcp795.yaml
>> new file mode 100644
>> index 000000000000..77e465747d43
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/rtc/maxim,mcp795.yaml
>> @@ -0,0 +1,35 @@
>> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/rtc/maxim,mcp795.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Maxim MCP795 SPI Serial Real Time Clock
>> +
>> +allOf:
>> +  - $ref: rtc.yaml#
> 
> Nit: By convention, this goes after maintainers/description.
> 
>> +
>> +maintainers:
>> +  - Josef Gajdusek <atx@atx.name>
>> +
>> +properties:
>> +  compatible:
>> +    enum:
>> +      - maxim,mcp795
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +required:
>> +  - compatible
>> +  - reg
>> +
>> +additionalProperties: false
> 
> This should be unevaluatedProperties:false, so you allow other common
> RTC properties. But then, it is even smaller than trivial RTC devices, so:
> 1. What about interrupts? No interrupt line?
> 2. If there is interrupt line, just add it to trivial-rtc. Otherwise,
> it's fine here with changes above.
> 
> Best regards,
> Krzysztof
> 
The RTC has indeed an interrupt line and I just checked that the driver
supports it. Apparently the functionality was added later but never
documented.
The interrupt is optional and therefore it is a perfect candidate to get
into trivial-rtc in v2.

Thanks and best regards,
Javier Carrasco

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

end of thread, other threads:[~2023-09-06 11:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-06 10:23 [PATCH] dt-bindings: rtc: mcp795: convert to YAML Javier Carrasco
2023-09-06 10:42 ` Krzysztof Kozlowski
2023-09-06 11:48   ` Javier Carrasco
2023-09-06 11:31 ` Rob Herring

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).