diff mbox series

[1/2] dt-bindings: rtc: max31335: add max31335 bindings

Message ID 20231030115016.97823-2-antoniu.miclaus@analog.com
State New
Headers show
Series Add support for RTC MAX31335 | expand

Commit Message

Antoniu Miclaus Oct. 30, 2023, 11:50 a.m. UTC
Document the Analog Devices MAX31335 device tree bindings.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
 .../devicetree/bindings/rtc/adi,max31335.yaml | 61 +++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/rtc/adi,max31335.yaml

Comments

Antoniu Miclaus Oct. 31, 2023, 9:36 a.m. UTC | #1
> On 30/10/2023 12:50, Antoniu Miclaus wrote:
> > Document the Analog Devices MAX31335 device tree bindings.
> >
> > Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> > ---
> >  .../devicetree/bindings/rtc/adi,max31335.yaml | 61
> +++++++++++++++++++
> >  1 file changed, 61 insertions(+)
> >  create mode 100644
> Documentation/devicetree/bindings/rtc/adi,max31335.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/rtc/adi,max31335.yaml
> b/Documentation/devicetree/bindings/rtc/adi,max31335.yaml
> > new file mode 100644
> > index 000000000000..b84be0fa34ef
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/rtc/adi,max31335.yaml
> > @@ -0,0 +1,61 @@
> > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> > +%YAML 1.2
> > +---
> > +$id:
> https://urldefense.com/v3/__http://devicetree.org/schemas/rtc/adi,max31
> 335.yaml*__;Iw!!A3Ni8CS0y2Y!8dEITWcTQ-
> eZ_KG0TRlZ9ghWuDPnZwR1oR5OpGyvJkmAOxsFxDYI7rUqR-
> U_KSQcGbkqxJ3glqBcJa_jjbukeVtyVSw-LCq3$
> > +$schema: https://urldefense.com/v3/__http://devicetree.org/meta-
> schemas/core.yaml*__;Iw!!A3Ni8CS0y2Y!8dEITWcTQ-
> eZ_KG0TRlZ9ghWuDPnZwR1oR5OpGyvJkmAOxsFxDYI7rUqR-
> U_KSQcGbkqxJ3glqBcJa_jjbukeVtyVRI7679n$
> > +
> > +title: Analog Devices MAX31335 RTC Device Tree Bindings
> 
> It does not look like you tested the bindings, at least after quick
> look. Please run `make dt_binding_check` (see
> Documentation/devicetree/bindings/writing-schema.rst for instructions).
> Maybe you need to update your dtschema and yamllint.
Indeed I was using an older dtschema version locally and the dt_binding_check
was not throwing any errors. will address the comments in the next version.
> Although I wonder why there is no error report from the bot.
> 
> Drop "Device Tree Bindings"
> 
> > +
> > +allOf:
> > +  - $ref: rtc.yaml#
> 
> This goes after description. Several existing files have it in other
> place, but if doing changes then well...
> 
> > +
> > +maintainers:
> > +  - Antoniu Miclaus <antoniu.miclaus@analog.com>
> > +
> > +description: Analog Devices MAX31335 I2C RTC
> 
> Drop or say something else than title.
> 
> 
> > +
> > +properties:
> > +  compatible:
> > +    const: adi,max31335
> > +
> > +  reg:
> > +    description: I2C address of the RTC
> 
> Drop description, obvious.
> 
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  "#clock-cells":
> > +    description:
> > +      RTC can be used as a clock source through its clock output pin.
> > +    const: 0
> > +
> > +  trickle-resistor-ohms:
> > +    description: Selected resistor for trickle charger.
> > +    enum: [3000, 6000, 11000]
> 
> default? Or missing property has other meaning...
> 
> > +
> > +  trickle-diode-enable: true
> 
> Where is it defined? You added it as it was a common property, so where
> is the one definition? Maybe you wanted to use other property from
> rtc.yaml which is deprecated, so obviously not...
> 
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> 
> Best regards,
> Krzysztof
Antoniu Miclaus Oct. 31, 2023, 10:29 a.m. UTC | #2
--
Antoniu Miclăuş

> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Sent: Monday, October 30, 2023 7:25 PM
> To: Miclaus, Antoniu <Antoniu.Miclaus@analog.com>; Alessandro Zummo
> <a.zummo@towertech.it>; Alexandre Belloni
> <alexandre.belloni@bootlin.com>; Rob Herring <robh+dt@kernel.org>;
> Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>; Conor Dooley
> <conor+dt@kernel.org>; Jean Delvare <jdelvare@suse.com>; Guenter
> Roeck <linux@roeck-us.net>; linux-rtc@vger.kernel.org;
> devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-
> hwmon@vger.kernel.org
> Subject: Re: [PATCH 1/2] dt-bindings: rtc: max31335: add max31335 bindings
> 
> [External]
> 
> On 30/10/2023 12:50, Antoniu Miclaus wrote:
> > Document the Analog Devices MAX31335 device tree bindings.
> >
> > Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> > ---
> >  .../devicetree/bindings/rtc/adi,max31335.yaml | 61
> +++++++++++++++++++
> >  1 file changed, 61 insertions(+)
> >  create mode 100644
> Documentation/devicetree/bindings/rtc/adi,max31335.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/rtc/adi,max31335.yaml
> b/Documentation/devicetree/bindings/rtc/adi,max31335.yaml
> > new file mode 100644
> > index 000000000000..b84be0fa34ef
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/rtc/adi,max31335.yaml
> > @@ -0,0 +1,61 @@
> > +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> > +%YAML 1.2
> > +---
> > +$id:
> https://urldefense.com/v3/__http://devicetree.org/schemas/rtc/adi,max31
> 335.yaml*__;Iw!!A3Ni8CS0y2Y!8dEITWcTQ-
> eZ_KG0TRlZ9ghWuDPnZwR1oR5OpGyvJkmAOxsFxDYI7rUqR-
> U_KSQcGbkqxJ3glqBcJa_jjbukeVtyVSw-LCq3$
> > +$schema: https://urldefense.com/v3/__http://devicetree.org/meta-
> schemas/core.yaml*__;Iw!!A3Ni8CS0y2Y!8dEITWcTQ-
> eZ_KG0TRlZ9ghWuDPnZwR1oR5OpGyvJkmAOxsFxDYI7rUqR-
> U_KSQcGbkqxJ3glqBcJa_jjbukeVtyVRI7679n$
> > +
> > +title: Analog Devices MAX31335 RTC Device Tree Bindings
> 
> It does not look like you tested the bindings, at least after quick
> look. Please run `make dt_binding_check` (see
> Documentation/devicetree/bindings/writing-schema.rst for instructions).
> Maybe you need to update your dtschema and yamllint.
> 
> Although I wonder why there is no error report from the bot.
> 
> Drop "Device Tree Bindings"
> 
> > +
> > +allOf:
> > +  - $ref: rtc.yaml#
> 
> This goes after description. Several existing files have it in other
> place, but if doing changes then well...
> 
> > +
> > +maintainers:
> > +  - Antoniu Miclaus <antoniu.miclaus@analog.com>
> > +
> > +description: Analog Devices MAX31335 I2C RTC
> 
> Drop or say something else than title.
> 
> 
> > +
> > +properties:
> > +  compatible:
> > +    const: adi,max31335
> > +
> > +  reg:
> > +    description: I2C address of the RTC
> 
> Drop description, obvious.
> 
> > +    maxItems: 1
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +
> > +  "#clock-cells":
> > +    description:
> > +      RTC can be used as a clock source through its clock output pin.
> > +    const: 0
> > +
> > +  trickle-resistor-ohms:
> > +    description: Selected resistor for trickle charger.
> > +    enum: [3000, 6000, 11000]
> 
> default? Or missing property has other meaning...

If trickle-resistor-ohms property is missing, then the trickle charger setup is skipped.

> 
> > +
> > +  trickle-diode-enable: true
> 
> Where is it defined? You added it as it was a common property, so where
> is the one definition? Maybe you wanted to use other property from
> rtc.yaml which is deprecated, so obviously not...
> 
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +
> 
> Best regards,
> Krzysztof
Rob Herring Oct. 31, 2023, 12:06 p.m. UTC | #3
On Mon, 30 Oct 2023 13:50:01 +0200, Antoniu Miclaus wrote:
> Document the Analog Devices MAX31335 device tree bindings.
> 
> Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
> ---
>  .../devicetree/bindings/rtc/adi,max31335.yaml | 61 +++++++++++++++++++
>  1 file changed, 61 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/rtc/adi,max31335.yaml
> 

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:
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/rtc/adi,max31335.yaml: title: 'Analog Devices MAX31335 RTC Device Tree Bindings' should not be valid under {'pattern': '([Bb]inding| [Ss]chema)'}
	hint: Everything is a binding/schema, no need to say it. Describe what hardware the binding is for.
	from schema $id: http://devicetree.org/meta-schemas/base.yaml#
/builds/robherring/dt-review-ci/linux/Documentation/devicetree/bindings/rtc/adi,max31335.yaml: trickle-diode-enable: missing type definition

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20231030115016.97823-2-antoniu.miclaus@analog.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.
Krzysztof Kozlowski Oct. 31, 2023, 1:53 p.m. UTC | #4
On 31/10/2023 11:29, Miclaus, Antoniu wrote:

>>> +    maxItems: 1
>>> +
>>> +  interrupts:
>>> +    maxItems: 1
>>> +
>>> +  "#clock-cells":
>>> +    description:
>>> +      RTC can be used as a clock source through its clock output pin.
>>> +    const: 0
>>> +
>>> +  trickle-resistor-ohms:
>>> +    description: Selected resistor for trickle charger.
>>> +    enum: [3000, 6000, 11000]
>>
>> default? Or missing property has other meaning...
> 
> If trickle-resistor-ohms property is missing, then the trickle charger setup is skipped.

Then mention this.

Best regards,
Krzysztof
Antoniu Miclaus Oct. 31, 2023, 2:44 p.m. UTC | #5
> On 31/10/2023 11:29, Miclaus, Antoniu wrote:
> 
> >>> +    maxItems: 1
> >>> +
> >>> +  interrupts:
> >>> +    maxItems: 1
> >>> +
> >>> +  "#clock-cells":
> >>> +    description:
> >>> +      RTC can be used as a clock source through its clock output pin.
> >>> +    const: 0
> >>> +
> >>> +  trickle-resistor-ohms:
> >>> +    description: Selected resistor for trickle charger.
> >>> +    enum: [3000, 6000, 11000]
> >>
> >> default? Or missing property has other meaning...
> >
> > If trickle-resistor-ohms property is missing, then the trickle charger setup is
> skipped.
> 
> Then mention this.
> 

 Will do in v3.

> Best regards,
> Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/rtc/adi,max31335.yaml b/Documentation/devicetree/bindings/rtc/adi,max31335.yaml
new file mode 100644
index 000000000000..b84be0fa34ef
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/adi,max31335.yaml
@@ -0,0 +1,61 @@ 
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/adi,max31335.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices MAX31335 RTC Device Tree Bindings
+
+allOf:
+  - $ref: rtc.yaml#
+
+maintainers:
+  - Antoniu Miclaus <antoniu.miclaus@analog.com>
+
+description: Analog Devices MAX31335 I2C RTC
+
+properties:
+  compatible:
+    const: adi,max31335
+
+  reg:
+    description: I2C address of the RTC
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  "#clock-cells":
+    description:
+      RTC can be used as a clock source through its clock output pin.
+    const: 0
+
+  trickle-resistor-ohms:
+    description: Selected resistor for trickle charger.
+    enum: [3000, 6000, 11000]
+
+  trickle-diode-enable: true
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        rtc@68 {
+            compatible = "adi,max31335";
+            reg = <0x68>;
+            pinctrl-0 = <&rtc_nint_pins>;
+            interrupts-extended = <&gpio1 16 IRQ_TYPE_LEVEL_HIGH>;
+            trickle-resistor-ohms = <6000>;
+            trickle-diode-enable;
+        };
+    };
+...