Skip to content

Commit 99fd09e

Browse files
jonasjelonekAndi Shyti
authored andcommitted
dt-bindings: i2c: realtek,rtl9301-i2c: extend for RTL9310 support
Adjust the regex for child-node address to account for the fact that RTL9310 supports 12 instead of only 8 SDA lines. Also, narrow this per variant. Add a vendor-specific property to explicitly specify the SCL line number of the defined I2C controller/master. This is required, in particular for RTL9310, to operate on the correct SCL for each controller. Require this property to be specified for RTL9310. Add compatibles for known SoC variants RTL9311, RTL9312 and RTL9313. Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Tested-by: Markus Stockhausen <markus.stockhausen@gmx.de> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20250927101931.71575-9-jelonek.jonas@gmail.com
1 parent 46fe826 commit 99fd09e

1 file changed

Lines changed: 37 additions & 2 deletions

File tree

Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ description:
1313
RTL9300 SoCs have two I2C controllers. Each of these has an SCL line (which
1414
if not-used for SCL can be a GPIO). There are 8 common SDA lines that can be
1515
assigned to either I2C controller.
16+
RTL9310 SoCs have equal capabilities but support 12 common SDA lines which
17+
can be assigned to either I2C controller.
1618

1719
properties:
1820
compatible:
@@ -23,7 +25,15 @@ properties:
2325
- realtek,rtl9302c-i2c
2426
- realtek,rtl9303-i2c
2527
- const: realtek,rtl9301-i2c
26-
- const: realtek,rtl9301-i2c
28+
- items:
29+
- enum:
30+
- realtek,rtl9311-i2c
31+
- realtek,rtl9312-i2c
32+
- realtek,rtl9313-i2c
33+
- const: realtek,rtl9310-i2c
34+
- enum:
35+
- realtek,rtl9301-i2c
36+
- realtek,rtl9310-i2c
2737

2838
reg:
2939
items:
@@ -35,8 +45,14 @@ properties:
3545
"#size-cells":
3646
const: 0
3747

48+
realtek,scl:
49+
$ref: /schemas/types.yaml#/definitions/uint32
50+
description:
51+
The SCL line number of this I2C controller.
52+
enum: [ 0, 1 ]
53+
3854
patternProperties:
39-
'^i2c@[0-7]$':
55+
'^i2c@[0-9ab]$':
4056
$ref: /schemas/i2c/i2c-controller.yaml
4157
unevaluatedProperties: false
4258

@@ -48,6 +64,25 @@ patternProperties:
4864
required:
4965
- reg
5066

67+
68+
allOf:
69+
- if:
70+
properties:
71+
compatible:
72+
contains:
73+
const: realtek,rtl9310-i2c
74+
then:
75+
required:
76+
- realtek,scl
77+
- if:
78+
properties:
79+
compatible:
80+
contains:
81+
const: realtek,rtl9301-i2c
82+
then:
83+
patternProperties:
84+
'^i2c@[89ab]$': false
85+
5186
required:
5287
- compatible
5388
- reg

0 commit comments

Comments
 (0)