[PATCH v8 3/7] dt-bindings: i2c: Add Realtek RTL I2C Controller

Chris Packham posted 7 patches 3 weeks, 3 days ago
There is a newer version of this series
[PATCH v8 3/7] dt-bindings: i2c: Add Realtek RTL I2C Controller
Posted by Chris Packham 3 weeks, 3 days ago
Add dt-schema for the I2C controller on the RTL9300 Ethernet switch
with integrated SoC.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
---

Notes:
    Changes in v8:
    - New(ish). At Lee's request I've moved the i2c binding into a separate
      patch so the mfd change can be taken via Lee's tree. I've added a r-by
      from Krzysztof from the v7 ov the combined patch, I hope that's OK.

 .../bindings/i2c/realtek,rtl9301-i2c.yaml     | 69 +++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml

diff --git a/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml b/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml
new file mode 100644
index 000000000000..eddfd329c67b
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml
@@ -0,0 +1,69 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/realtek,rtl9301-i2c.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Realtek RTL I2C Controller
+
+maintainers:
+  - Chris Packham <chris.packham@alliedtelesis.co.nz>
+
+description:
+  The RTL9300 SoC has two I2C controllers. Each of these has an SCL line (which
+  if not-used for SCL can be a GPIO). There are 8 common SDA lines that can be
+  assigned to either I2C controller.
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - realtek,rtl9302b-i2c
+              - realtek,rtl9302c-i2c
+              - realtek,rtl9303-i2c
+          - const: realtek,rtl9301-i2c
+      - const: realtek,rtl9301-i2c
+
+  reg:
+    description: Register offset and size this I2C controller.
+
+  "#address-cells":
+    const: 1
+
+  "#size-cells":
+    const: 0
+
+patternProperties:
+  '^i2c@[0-7]$':
+    $ref: /schemas/i2c/i2c-controller.yaml
+    unevaluatedProperties: false
+
+    properties:
+      reg:
+        description: The SDA pin associated with the I2C bus.
+        maxItems: 1
+
+    required:
+      - reg
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    i2c@36c {
+      compatible = "realtek,rtl9301-i2c";
+      reg = <0x36c 0x14>;
+      #address-cells = <1>;
+      #size-cells = <0>;
+
+      i2c@2 {
+        reg = <2>;
+        #address-cells = <1>;
+        #size-cells = <0>;
+      };
+    };
-- 
2.47.0
Re: [PATCH v8 3/7] dt-bindings: i2c: Add Realtek RTL I2C Controller
Posted by Andi Shyti 2 weeks, 5 days ago
Hi Chris,

On Fri, Nov 01, 2024 at 09:03:46AM +1300, Chris Packham wrote:
> Add dt-schema for the I2C controller on the RTL9300 Ethernet switch
> with integrated SoC.
> 
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Agree with Krzysztof's comment in Patch 1. Please don't send
merged patches.

Now this 3/7 patch is also merged to i2c/i2c-host.

Andi
Re: [PATCH v8 3/7] dt-bindings: i2c: Add Realtek RTL I2C Controller
Posted by Chris Packham 2 weeks, 5 days ago
On 6/11/24 09:59, Andi Shyti wrote:
> Hi Chris,
>
> On Fri, Nov 01, 2024 at 09:03:46AM +1300, Chris Packham wrote:
>> Add dt-schema for the I2C controller on the RTL9300 Ethernet switch
>> with integrated SoC.
>>
>> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Agree with Krzysztof's comment in Patch 1. Please don't send
> merged patches.

Yes understood.  I'll avoid doing so if there is another round (I 
haven't heard from the mips maintainer yet so there might be feedback on 
those 2 patches).

> Now this 3/7 patch is also merged to i2c/i2c-host.

Thanks, much appreciated.