diff mbox series

[16/21] dt-bindings: i2c: add i2c/twi driver documentation

Message ID 20240912-test-v1-16-458fa57c8ccf@analog.com (mailing list archive)
State New
Headers show
Series Adding support of ADI ARMv8 ADSP-SC598 SoC. | expand

Commit Message

Arturs Artamonovs via B4 Relay Sept. 12, 2024, 6:25 p.m. UTC
From: Arturs Artamonovs <arturs.artamonovs@analog.com>

Add I2C driver bindings.

Signed-off-by: Arturs Artamonovs <Arturs.Artamonovs@analog.com>
Co-developed-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Signed-off-by: Nathan Barrett-Morrison <nathan.morrison@timesys.com>
Co-developed-by: Greg Malysa <greg.malysa@timesys.com>
Signed-off-by: Greg Malysa <greg.malysa@timesys.com>
---
 Documentation/devicetree/bindings/i2c/adi,twi.yaml | 71 ++++++++++++++++++++++
 1 file changed, 71 insertions(+)

Comments

Arnd Bergmann Sept. 13, 2024, 7:24 a.m. UTC | #1
On Thu, Sep 12, 2024, at 18:25, Arturs Artamonovs via B4 Relay wrote:
> +
> +properties:
> +  compatible:
> +    enum:
> +      - adi,twi
> +

The "adi,twi" string is not specific enough to identify a particular
implementation, the name should either include the version of the
IP block that was used in each chip, or (if that is not public
knowledge) the identifier of the chip it was integrated in.

      Arnd
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/i2c/adi,twi.yaml b/Documentation/devicetree/bindings/i2c/adi,twi.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..e935b09066cf806c89a796fdd5fe73ee0b644432
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/adi,twi.yaml
@@ -0,0 +1,71 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/adi,twi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Analog Devices I2C Peripheral for SC5XX Processor Family
+
+maintainers:
+  - Arturs Artamonovs <arturs.artamonovs@analog.com>
+  - Utsav Agarwal <Utsav.Agarwal@analog.com>
+
+description: |
+  Analog Devices I2C Peripheral driver for SC5XX Processor Family
+
+properties:
+  compatible:
+    enum:
+      - adi,twi
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clock-khz:
+    $ref: /schemas/types.yaml#/definitions/uint32
+
+  clocks:
+    maxItems: 1
+
+  clock-names:
+    maxItems: 1
+
+required:
+  - compatible
+  - "#address-cells"
+  - "#size-cells"
+  - reg
+  - interrupts
+  - clock-khz
+  - clocks
+  - clock-names
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/clock/adi-sc5xx-clock.h>
+
+    i2c0: twi@31001400 {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      compatible = "adi,twi";
+      reg = <0x31001400 0xFF>;
+      interrupts = <GIC_SPI 150 IRQ_TYPE_LEVEL_HIGH>;
+      clock-khz = <100>;
+      clocks = <&clk ADSP_SC598_CLK_CGU0_SCLK0>;
+      clock-names = "sclk0";
+      status = "disabled";
+    };
+