Thread (33 messages) 33 messages, 8 authors, 2021-08-06

Re: [PATCH 5/7] dt-bindings: soc: imx: add missing anatop binding

From: Dong Aisheng <hidden>
Date: 2021-08-02 11:38:46
Also in: linux-devicetree

Hi Rob,

On Thu, Jul 22, 2021 at 10:49 AM Rob Herring [off-list ref] wrote:
On Thu, Jul 15, 2021 at 04:25:34PM +0800, Dong Aisheng wrote:
quoted
Anatop is a system combo module which supports various analog functions
like PLL, Regulators, LDOs, Sensors and etc.
This binding doc is generated based on the exist usage in dts
in order to fix dt schema check failures.

Cc: Rob Herring <robh+dt@kernel.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
 .../bindings/soc/imx/fsl,anatop.yaml          | 68 +++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml
diff --git a/Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml b/Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml
new file mode 100644
index 000000000000..f379d960f527
--- /dev/null
+++ b/Documentation/devicetree/bindings/soc/imx/fsl,anatop.yaml
@@ -0,0 +1,68 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/soc/imx/fsl,anatop.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Freescale Anatop binding
+
+maintainers:
+  - Dong Aisheng <aisheng.dong@nxp.com>
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - const: fsl,imx6q-anatop
+          - const: syscon
+          - const: simple-mfd
+      - items:
+          - enum:
+              - fsl,imx6sl-anatop
+              - fsl,imx6sll-anatop
+              - fsl,imx6sx-anatop
+              - fsl,imx6ul-anatop
+              - fsl,imx7d-anatop
+          - const: fsl,imx6q-anatop
+          - const: syscon
+          - const: simple-mfd
+      - items:
+          - enum:
+              - fsl,imx8mq-anatop
+              - fsl,imx8mm-anatop
+              - fsl,vf610-anatop
+          - const: syscon
+      - items:
+          - enum:
+              - fsl,imx8mn-anatop
+              - fsl,imx8mp-anatop
+          - const: fsl,imx8mm-anatop
+          - const: syscon
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    items:
+      - description: Temperature Sensor
+      - description: PMU interrupt 1
+      - description: PMU interrupt 2
+    minItems: 1
+    maxItems: 3
Don't need maxItems.
Got it
quoted
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: true
This should be the case only for common schemas used by other schemas.
Like iomuxc-gpr in patch 6, the problem is that for those nodes with
simple-mfd backwards compatibility,
there could be possibly some random subnodes since there're generic
combo registers.
That's why i use additionalProperties true to cover it.
Do you think it's ok?

e.g.
anatop: anatop@20c8000 {
        compatible = "fsl,imx6q-anatop", "syscon", "simple-mfd";
        reg = <0x020c8000 0x1000>;
        interrupts = <0 49 IRQ_TYPE_LEVEL_HIGH>,
                     <0 54 IRQ_TYPE_LEVEL_HIGH>,
                     <0 127 IRQ_TYPE_LEVEL_HIGH>;

        reg_vdd1p1: regulator-1p1 {
                compatible = "fsl,anatop-regulator";
                regulator-name = "vdd1p1";
                regulator-min-microvolt = <1000000>;
                regulator-max-microvolt = <1200000>;
                ...
        };

        tempmon: tempmon {
                compatible = "fsl,imx6q-tempmon";
                interrupt-parent = <&gpc>;
                interrupts = <0 49 IRQ_TYPE_LEVEL_HIGH>;
                fsl,tempmon = <&anatop>;
                nvmem-cells = <&tempmon_calib>, <&tempmon_temp_grade>;
                nvmem-cell-names = "calib", "temp_grade";
                clocks = <&clks IMX6QDL_CLK_PLL3_USB_OTG>;
                #thermal-sensor-cells = <0>;
        };
};

gpr: iomuxc-gpr@20e0000 {
        compatible = "fsl,imx6q-iomuxc-gpr", "syscon", "simple-mfd";
        reg = <0x20e0000 0x38>;

        mux: mux-controller {
                compatible = "mmio-mux";
                #mux-control-cells = <1>;
        };
};
quoted
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    anatop: anatop@20c8000 {
Got it

Regards
Aisheng
Drop unused labels.
quoted
+        compatible = "fsl,imx6q-anatop", "syscon", "simple-mfd";
+        reg = <0x020c8000 0x1000>;
+        interrupts = <0 49 IRQ_TYPE_LEVEL_HIGH>,
+                     <0 54 IRQ_TYPE_LEVEL_HIGH>,
+                     <0 127 IRQ_TYPE_LEVEL_HIGH>;
+        };
--
2.25.1
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help