diff mbox series

[v3,1/2] dt-bindings: lan9662-otpc: document Lan9662 OTPC

Message ID 20220831064238.102267-2-horatiu.vultur@microchip.com
State Superseded, archived
Headers show
Series nvmem: lan9662-otpc: add support | expand

Checks

Context Check Description
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success
robh/checkpatch success
robh/patch-applied success
robh/dtbs-check warning build log
robh/dt-meta-schema success

Commit Message

Horatiu Vultur Aug. 31, 2022, 6:42 a.m. UTC
Document Lan9662 OTP controller.

Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
---
 .../nvmem/microchip,lan9662-otpc.yaml         | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml

Comments

Krzysztof Kozlowski Aug. 31, 2022, 7:28 a.m. UTC | #1
On 31/08/2022 09:42, Horatiu Vultur wrote:
> Document Lan9662 OTP controller.
> 
> Signed-off-by: Horatiu Vultur <horatiu.vultur@microchip.com>
> ---
>  .../nvmem/microchip,lan9662-otpc.yaml         | 45 +++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
> 
> diff --git a/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml b/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
> new file mode 100644
> index 000000000000..def20733cf60
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
> @@ -0,0 +1,45 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/nvmem/microchip,lan9662-otpc.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Microchip LAN9662 OTP Controller (OTPC)
> +
> +maintainers:
> +  - Horatiu Vultur <horatiu.vultur@microchip.com>
> +
> +description: |
> +  OTP controller drives a NVMEM memory where system specific data
> +  (e.g. hardware configuration settings, chip identifiers) or
> +  user specific data could be stored.
> +
> +allOf:
> +  - $ref: nvmem.yaml#
> +
> +properties:
> +  compatible:
> +    oneOf:
> +      - items:
> +          - const: microchip,lan9662-otpc
> +          - const: microchip,lan9668-otpc
> +      - enum:
> +          - microchip,lan9662-otpc

This is not what I wrote and this does not make sense. You now listed
twice 9662 and 9668 does not have its entry.

Best regards,
Krzysztof
Horatiu Vultur Aug. 31, 2022, 10:44 a.m. UTC | #2
The 08/31/2022 10:28, Krzysztof Kozlowski wrote:

Hi Krzysztof,

> > +
> > +properties:
> > +  compatible:
> > +    oneOf:
> > +      - items:
> > +          - const: microchip,lan9662-otpc
> > +          - const: microchip,lan9668-otpc
> > +      - enum:
> > +          - microchip,lan9662-otpc
> 
> This is not what I wrote and this does not make sense. You now listed
> twice 9662 and 9668 does not have its entry.

As you figured it out, I am quite noob at these bindings.
The only difference between what you wrote and what I wrote is the order
under items. So the order matters?

> 
> Best regards,
> Krzysztof
Krzysztof Kozlowski Aug. 31, 2022, 12:45 p.m. UTC | #3
On 31/08/2022 13:44, Horatiu Vultur wrote:
> The 08/31/2022 10:28, Krzysztof Kozlowski wrote:
> 
> Hi Krzysztof,
> 
>>> +
>>> +properties:
>>> +  compatible:
>>> +    oneOf:
>>> +      - items:
>>> +          - const: microchip,lan9662-otpc
>>> +          - const: microchip,lan9668-otpc
>>> +      - enum:
>>> +          - microchip,lan9662-otpc
>>
>> This is not what I wrote and this does not make sense. You now listed
>> twice 9662 and 9668 does not have its entry.
> 
> As you figured it out, I am quite noob at these bindings.
> The only difference between what you wrote and what I wrote is the order
> under items. So the order matters?

Yes, because it is not an enum but list. What you wrote is:
compatible = "microchip,lan9662-otpc", "microchip,lan9668-otpc"

and you would see the problems if you tested it with lan9668.

Best regards,
Krzysztof
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml b/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
new file mode 100644
index 000000000000..def20733cf60
--- /dev/null
+++ b/Documentation/devicetree/bindings/nvmem/microchip,lan9662-otpc.yaml
@@ -0,0 +1,45 @@ 
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/nvmem/microchip,lan9662-otpc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Microchip LAN9662 OTP Controller (OTPC)
+
+maintainers:
+  - Horatiu Vultur <horatiu.vultur@microchip.com>
+
+description: |
+  OTP controller drives a NVMEM memory where system specific data
+  (e.g. hardware configuration settings, chip identifiers) or
+  user specific data could be stored.
+
+allOf:
+  - $ref: nvmem.yaml#
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - const: microchip,lan9662-otpc
+          - const: microchip,lan9668-otpc
+      - enum:
+          - microchip,lan9662-otpc
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    otpc: otp@e0021000 {
+        compatible = "microchip,lan9662-otpc";
+        reg = <0xe0021000 0x300>;
+    };
+
+...