Add the "realtek,rtl9607-i2c" compatible for i2c controller on the
RTL9607C SoC series.
Add a clocks property to the properties to describe the i2c reference
clock and make it available for all the compatibles. This i2c reference
clock is assumed to be coming from switchcore region via Lexra bus as
the other SoC peripherals.
RTL9607C requires the "realtek,scl" and "clocks" to be specified
and so handle it under separate if check for "realtek,rtl9607-i2c".
Signed-off-by: Rustam Adilov <adilov@disroot.org>
---
.../bindings/i2c/realtek,rtl9301-i2c.yaml | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml b/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml
index f9a449fee2b0..5873cfdc5b3e 100644
--- a/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml
+++ b/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml
@@ -15,6 +15,8 @@ description:
assigned to either I2C controller.
RTL9310 SoCs have equal capabilities but support 12 common SDA lines which
can be assigned to either I2C controller.
+ RTL9607C SoCs have equal capabilities but each controller only supports 1
+ SCL/SDA line.
properties:
compatible:
@@ -34,6 +36,7 @@ properties:
- enum:
- realtek,rtl9301-i2c
- realtek,rtl9310-i2c
+ - realtek,rtl9607-i2c
reg:
items:
@@ -51,6 +54,9 @@ properties:
The SCL line number of this I2C controller.
enum: [ 0, 1 ]
+ clocks:
+ maxItems: 1
+
patternProperties:
'^i2c@[0-9ab]$':
$ref: /schemas/i2c/i2c-controller.yaml
@@ -81,6 +87,15 @@ allOf:
then:
patternProperties:
'^i2c@[89ab]$': false
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: realtek,rtl9607-i2c
+ then:
+ required:
+ - realtek,scl
+ - clocks
required:
- compatible
--
2.53.0
On Mon, Mar 23, 2026 at 12:13:34PM +0500, Rustam Adilov wrote: > Add the "realtek,rtl9607-i2c" compatible for i2c controller on the > RTL9607C SoC series. > > Add a clocks property to the properties to describe the i2c reference > clock and make it available for all the compatibles. This i2c reference Why? I can see that you're doing that, and it's good to know that that is intentional, but why is it being done? Need to explain that all of these devices actually do have this clock etc. > clock is assumed to be coming from switchcore region via Lexra bus as > the other SoC peripherals. > > RTL9607C requires the "realtek,scl" and "clocks" to be specified > and so handle it under separate if check for "realtek,rtl9607-i2c". > > Signed-off-by: Rustam Adilov <adilov@disroot.org> > --- > .../bindings/i2c/realtek,rtl9301-i2c.yaml | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml b/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml > index f9a449fee2b0..5873cfdc5b3e 100644 > --- a/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml > +++ b/Documentation/devicetree/bindings/i2c/realtek,rtl9301-i2c.yaml > @@ -15,6 +15,8 @@ description: > assigned to either I2C controller. > RTL9310 SoCs have equal capabilities but support 12 common SDA lines which > can be assigned to either I2C controller. > + RTL9607C SoCs have equal capabilities but each controller only supports 1 > + SCL/SDA line. > > properties: > compatible: > @@ -34,6 +36,7 @@ properties: > - enum: > - realtek,rtl9301-i2c > - realtek,rtl9310-i2c > + - realtek,rtl9607-i2c > > reg: > items: > @@ -51,6 +54,9 @@ properties: > The SCL line number of this I2C controller. > enum: [ 0, 1 ] > > + clocks: > + maxItems: 1 > + > patternProperties: > '^i2c@[0-9ab]$': > $ref: /schemas/i2c/i2c-controller.yaml > @@ -81,6 +87,15 @@ allOf: > then: > patternProperties: > '^i2c@[89ab]$': false > + - if: > + properties: > + compatible: > + contains: > + const: realtek,rtl9607-i2c > + then: > + required: > + - realtek,scl > + - clocks > > required: > - compatible > -- > 2.53.0 >
Hello,
On 2026-03-23 19:41, Conor Dooley wrote:
> On Mon, Mar 23, 2026 at 12:13:34PM +0500, Rustam Adilov wrote:
>> Add the "realtek,rtl9607-i2c" compatible for i2c controller on the
>> RTL9607C SoC series.
>>
>> Add a clocks property to the properties to describe the i2c reference
>> clock and make it available for all the compatibles. This i2c reference
>
> Why? I can see that you're doing that, and it's good to know that that
> is intentional, but why is it being done? Need to explain that all of
> these devices actually do have this clock etc.
As far as available information goes, there are some datasheets that note
the existence of these clocks. For example, RTL9310 Developer Guide 1.0 in [1]
mentions "I2C master support 12 peripherals with 2 clocks" at page 19.
And RTL9607 calculates the clk_div with this equation found in Realtek SDK code
data = (62500 / clock) - 1;
where clock is clock frequency in kHz and so the 62500 must be the clock frequency
of the i2c master controller clock in kHz. And since there are 2 i2c controllers,
there are 2 clocks.
That is also the reason why it the rtl9607 is the only one to require the clocks to
be specified and also why the clocks property was added at all.
That's how the rtl9607 i2c controller would look like
i2cclock: i2cclock {
#clock-cells = <0>;
compatible = "fixed-clock";
/* 62.5 MHz */
clock-frequency = <62500000>;
};
i2c@b4 {
compatible = "realtek,rtl9607-i2c";
reg = <0xb4 0x4>;
#address-cells = <1>;
#size-cells = <0>;
clocks = <&i2cclock>;
realtek,scl = <0>;
i2c@0 {
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
};
};
I hope this explains the whole intention behind it. And if there is better way to explain
this in the commit message, let me know.
[1] - https://github.com/plappermaul/realtek-doc/tree/main/datasheets
Best,
Rustam
On Tue, Mar 24, 2026 at 03:30:34PM +0000, Rustam Adilov wrote: > Hello, > On 2026-03-23 19:41, Conor Dooley wrote: > > On Mon, Mar 23, 2026 at 12:13:34PM +0500, Rustam Adilov wrote: > >> Add the "realtek,rtl9607-i2c" compatible for i2c controller on the > >> RTL9607C SoC series. > >> > >> Add a clocks property to the properties to describe the i2c reference > >> clock and make it available for all the compatibles. This i2c reference > > > > Why? I can see that you're doing that, and it's good to know that that > > is intentional, but why is it being done? Need to explain that all of > > these devices actually do have this clock etc. > > As far as available information goes, there are some datasheets that note > the existence of these clocks. For example, RTL9310 Developer Guide 1.0 in [1] > mentions "I2C master support 12 peripherals with 2 clocks" at page 19. > I hope this explains the whole intention behind it. And if there is better way to explain > this in the commit message, let me know. What you need to say in the commit message effectively boils down to "the existing devices have these clocks too".
On 2026-03-24 17:48, Conor Dooley wrote: > On Tue, Mar 24, 2026 at 03:30:34PM +0000, Rustam Adilov wrote: >> Hello, >> On 2026-03-23 19:41, Conor Dooley wrote: >> > On Mon, Mar 23, 2026 at 12:13:34PM +0500, Rustam Adilov wrote: >> >> Add the "realtek,rtl9607-i2c" compatible for i2c controller on the >> >> RTL9607C SoC series. >> >> >> >> Add a clocks property to the properties to describe the i2c reference >> >> clock and make it available for all the compatibles. This i2c reference >> > >> > Why? I can see that you're doing that, and it's good to know that that >> > is intentional, but why is it being done? Need to explain that all of >> > these devices actually do have this clock etc. >> >> As far as available information goes, there are some datasheets that >> note >> the existence of these clocks. For example, RTL9310 Developer Guide >> 1.0 in [1] >> mentions "I2C master support 12 peripherals with 2 clocks" at page 19. > >> I hope this explains the whole intention behind it. And if there is >> better way to explain >> this in the commit message, let me know. > > What you need to say in the commit message effectively boils down to > "the existing devices have these clocks too". Alrighty then, will update the commit message in the next patch series. Thanks, Rustam
© 2016 - 2026 Red Hat, Inc.