[PATCH 2/7] dt-bindings: rtc: add bindings for m41t93

Akhilesh Patil posted 7 patches 4 weeks, 1 day ago
There is a newer version of this series
[PATCH 2/7] dt-bindings: rtc: add bindings for m41t93
Posted by Akhilesh Patil 4 weeks, 1 day ago
add DT bindings for m41t93 rtc in YAML format.

Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
---
 .../devicetree/bindings/rtc/st,m41t93.yaml    | 43 +++++++++++++++++++
 1 file changed, 43 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/st,m41t93.yaml

diff --git a/Documentation/devicetree/bindings/rtc/st,m41t93.yaml b/Documentation/devicetree/bindings/rtc/st,m41t93.yaml
new file mode 100644
index 000000000000..03673adc79db
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/st,m41t93.yaml
@@ -0,0 +1,43 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/st,m41t93.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: ST M41T93 RTC and compatible
+
+maintainers:
+  - Alexandre Belloni <alexandre.belloni@bootlin.com>
+
+properties:
+  compatible:
+    enum:
+      - st,m41t93
+
+  reg:
+    maxItems: 1
+
+  "#clock-cells":
+    const: 1
+
+allOf:
+  - $ref: rtc.yaml
+
+unevaluatedProperties: false
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+    spi {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      rtc@0 {
+        spi-max-frequency = <2000000>;
+        compatible = "st,m41t93";
+        reg = <0>;
+      };
+    };
+
-- 
2.34.1
Re: [PATCH 2/7] dt-bindings: rtc: add bindings for m41t93
Posted by Rob Herring (Arm) 4 weeks, 1 day ago
On Wed, 03 Sep 2025 19:55:59 +0530, Akhilesh Patil wrote:
> add DT bindings for m41t93 rtc in YAML format.
> 
> Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
> ---
>  .../devicetree/bindings/rtc/st,m41t93.yaml    | 43 +++++++++++++++++++
>  1 file changed, 43 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/rtc/st,m41t93.yaml
> 

My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/rtc/st,m41t93.example.dtb: rtc@0 (st,m41t93): Unevaluated properties are not allowed ('spi-max-frequency' was unexpected)
	from schema $id: http://devicetree.org/schemas/rtc/st,m41t93.yaml#

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/40c91cbb07140ecdf4f91afc118c2518e85041c3.1756908788.git.akhilesh@ee.iitb.ac.in

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.
Re: [PATCH 2/7] dt-bindings: rtc: add bindings for m41t93
Posted by Krzysztof Kozlowski 4 weeks, 1 day ago
On 03/09/2025 16:25, Akhilesh Patil wrote:
> add DT bindings for m41t93 rtc in YAML format.

A nit, subject: drop second/last, redundant "bindings". The
"dt-bindings" prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18


Please organize the patch documenting compatible (DT bindings) before
their user.
See also:
https://elixir.bootlin.com/linux/v6.14-rc6/source/Documentation/devicetree/bindings/submitting-patches.rst#L46

> 
> Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
> ---
>  .../devicetree/bindings/rtc/st,m41t93.yaml    | 43 +++++++++++++++++++
>  1 file changed, 43 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/rtc/st,m41t93.yaml
> 
> diff --git a/Documentation/devicetree/bindings/rtc/st,m41t93.yaml b/Documentation/devicetree/bindings/rtc/st,m41t93.yaml
> new file mode 100644
> index 000000000000..03673adc79db
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/st,m41t93.yaml
> @@ -0,0 +1,43 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/rtc/st,m41t93.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: ST M41T93 RTC and compatible
> +
> +maintainers:
> +  - Alexandre Belloni <alexandre.belloni@bootlin.com>

This should not be subsystem maintainer.

> +
> +properties:
> +  compatible:
> +    enum:
> +      - st,m41t93
> +
> +  reg:
> +    maxItems: 1
> +
> +  "#clock-cells":

Hm? Are you sure? Nothing in the driver nor commit msg suggests that.

> +    const: 1
> +
> +allOf:
> +  - $ref: rtc.yaml
> +
> +unevaluatedProperties: false

This goes after required. See example schema.

> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +    spi {
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +      rtc@0 {
> +        spi-max-frequency = <2000000>;

Does not look tested.

> +        compatible = "st,m41t93";
> +        reg = <0>;

Please follow DTS coding style. Which property is the first in the
coding style?

Best regards,
Krzysztof
Re: [PATCH 2/7] dt-bindings: rtc: add bindings for m41t93
Posted by Akhilesh Patil 3 weeks, 2 days ago
On Wed, Sep 03, 2025 at 04:30:53PM +0200, Krzysztof Kozlowski wrote:
> On 03/09/2025 16:25, Akhilesh Patil wrote:
> > add DT bindings for m41t93 rtc in YAML format.
> 
> A nit, subject: drop second/last, redundant "bindings". The
> "dt-bindings" prefix is already stating that these are bindings.
> See also:
> https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
> 
> 
> Please organize the patch documenting compatible (DT bindings) before
> their user.
> See also:
> https://elixir.bootlin.com/linux/v6.14-rc6/source/Documentation/devicetree/bindings/submitting-patches.rst#L46
> 

Hi Krzysztof, Thanks for the review and pointng out to these resources.
I will fix those as per the guidelines and share v2 of the series.

> > 
> > Signed-off-by: Akhilesh Patil <akhilesh@ee.iitb.ac.in>
> > ---
> >  .../devicetree/bindings/rtc/st,m41t93.yaml    | 43 +++++++++++++++++++
> >  1 file changed, 43 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/rtc/st,m41t93.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/rtc/st,m41t93.yaml b/Documentation/devicetree/bindings/rtc/st,m41t93.yaml
> > new file mode 100644
> > index 000000000000..03673adc79db
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/rtc/st,m41t93.yaml
> > @@ -0,0 +1,43 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/rtc/st,m41t93.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: ST M41T93 RTC and compatible
> > +
> > +maintainers:
> > +  - Alexandre Belloni <alexandre.belloni@bootlin.com>
> 
> This should not be subsystem maintainer.

okay.

> 
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - st,m41t93
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +  "#clock-cells":
> 
> Hm? Are you sure? Nothing in the driver nor commit msg suggests that.

This RTC chip has square wave output generation which can generate
clocks from 1Hz to 32KHz. Hence, this device can be clock provider and
other devices can be clock consumer via DT.
I will add this in the description.

> 
> > +    const: 1
> > +
> > +allOf:
> > +  - $ref: rtc.yaml
> > +
> > +unevaluatedProperties: false
> 
> This goes after required. See example schema.

sure.

> 
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> > +examples:
> > +  - |
> > +    spi {
> > +      #address-cells = <1>;
> > +      #size-cells = <0>;
> > +      rtc@0 {
> > +        spi-max-frequency = <2000000>;
> 
> Does not look tested.

Will run $ make dt_binding_check , retest on my board and add actual
node I test as an example here.

> 
> > +        compatible = "st,m41t93";
> > +        reg = <0>;
> 
> Please follow DTS coding style. Which property is the first in the
> coding style?

sure, will fix in v2 as much as understand referring resources you
shared and your DTS 101 talk from OSS 25 Europe.
Still, if I miss something do let me know on v2 series. 

Regards,
Akhilesh

> 
> Best regards,
> Krzysztof