7035005efc7cb58d74b6fd6f7479e6bb7f8496d5
[openwrt/openwrt.git] /
1 From 17689aafb793599a862617a127429dd3d6f675c9 Mon Sep 17 00:00:00 2001
2 From: Jonas Jelonek <jelonek.jonas@gmail.com>
3 Date: Sat, 27 Sep 2025 10:19:30 +0000
4 Subject: [PATCH] dt-bindings: i2c: realtek,rtl9301-i2c: extend for RTL9310
5 support
6
7 Adjust the regex for child-node address to account for the fact that
8 RTL9310 supports 12 instead of only 8 SDA lines. Also, narrow this per
9 variant.
10
11 Add a vendor-specific property to explicitly specify the SCL line number
12 of the defined I2C controller/master. This is required, in particular
13 for RTL9310, to operate on the correct SCL for each controller. Require
14 this property to be specified for RTL9310.
15
16 Add compatibles for known SoC variants RTL9311, RTL9312 and RTL9313.
17
18 Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
19 Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
20 Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
21 Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de>
22 Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
23 Link: https://lore.kernel.org/r/20250927101931.71575-9-jelonek.jonas@gmail.com
24
25 diff --git a/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml b/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml
26 index 274e2ab8b612..17ce39c19ab1 100644
27 --- a/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml
28 +++ b/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml
29 @@ -13,6 +13,8 @@ description:
30 RTL9300 SoCs have two I2C controllers. Each of these has an SCL line (which
31 if not-used for SCL can be a GPIO). There are 8 common SDA lines that can be
32 assigned to either I2C controller.
33 + RTL9310 SoCs have equal capabilities but support 12 common SDA lines which
34 + can be assigned to either I2C controller.
35
36 properties:
37 compatible:
38 @@ -23,7 +25,15 @@ properties:
39 - realtek,rtl9302c-i2c
40 - realtek,rtl9303-i2c
41 - const: realtek,rtl9301-i2c
42 - - const: realtek,rtl9301-i2c
43 + - items:
44 + - enum:
45 + - realtek,rtl9311-i2c
46 + - realtek,rtl9312-i2c
47 + - realtek,rtl9313-i2c
48 + - const: realtek,rtl9310-i2c
49 + - enum:
50 + - realtek,rtl9301-i2c
51 + - realtek,rtl9310-i2c
52
53 reg:
54 items:
55 @@ -35,8 +45,14 @@ properties:
56 "#size-cells":
57 const: 0
58
59 + realtek,scl:
60 + $ref: /schemas/types.yaml#/definitions/uint32
61 + description:
62 + The SCL line number of this I2C controller.
63 + enum: [ 0, 1 ]
64 +
65 patternProperties:
66 - '^i2c@[0-7]$':
67 + '^i2c@[0-9ab]$':
68 $ref: /schemas/i2c/i2c-controller.yaml
69 unevaluatedProperties: false
70
71 @@ -48,6 +64,25 @@ patternProperties:
72 required:
73 - reg
74
75 +
76 +allOf:
77 + - if:
78 + properties:
79 + compatible:
80 + contains:
81 + const: realtek,rtl9310-i2c
82 + then:
83 + required:
84 + - realtek,scl
85 + - if:
86 + properties:
87 + compatible:
88 + contains:
89 + const: realtek,rtl9301-i2c
90 + then:
91 + patternProperties:
92 + '^i2c@[89ab]$': false
93 +
94 required:
95 - compatible
96 - reg
97 --
98 2.48.1
99