Add a compatible string for the I2C controller found in SpacemiT K3 SoC
which use same I2C IP as K1, so make it fallback to K1 compatible.
Signed-off-by: Yixun Lan <dlan@kernel.org>
---
Documentation/devicetree/bindings/i2c/spacemit,k1-i2c.yaml | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/i2c/spacemit,k1-i2c.yaml b/Documentation/devicetree/bindings/i2c/spacemit,k1-i2c.yaml
index 5896fb120501..8c04c675b25e 100644
--- a/Documentation/devicetree/bindings/i2c/spacemit,k1-i2c.yaml
+++ b/Documentation/devicetree/bindings/i2c/spacemit,k1-i2c.yaml
@@ -14,7 +14,11 @@ allOf:
properties:
compatible:
- const: spacemit,k1-i2c
+ oneOf:
+ - items:
+ - const: spacemit,k3-i2c
+ - const: spacemit,k1-i2c
+ - const: spacemit,k1-i2c
reg:
maxItems: 1
--
2.53.0
Hi Yixun, On Wed, Mar 25, 2026 at 09:49:24AM +0000, Yixun Lan wrote: > Add a compatible string for the I2C controller found in SpacemiT K3 SoC > which use same I2C IP as K1, so make it fallback to K1 compatible. > > Signed-off-by: Yixun Lan <dlan@kernel.org> merged to i2c/i2c-host. Thanks, Andi
On Wed, Mar 25, 2026 at 09:49:24AM +0000, Yixun Lan wrote: > Add a compatible string for the I2C controller found in SpacemiT K3 SoC > which use same I2C IP as K1, so make it fallback to K1 compatible. > > Signed-off-by: Yixun Lan <dlan@kernel.org> Acked-by: Conor Dooley <conor.dooley@microchip.com> pw-bot: not-applicable
Yixun Lan <dlan@kernel.org> writes: > Add a compatible string for the I2C controller found in SpacemiT K3 SoC > which use same I2C IP as K1, so make it fallback to K1 compatible. > If is the same IP as K1, shouldn't the "spacemit,k1-i2c" compatible be used in the k3.dtsi instead? My understanding is that this is the meaning of compatible, and there's no need to add another compatible string for k3. -- Best regards, Javier Martinez Canillas Core Platforms Red Hat
On Wed, Mar 25, 2026 at 02:20:13PM +0100, Javier Martinez Canillas wrote: > Yixun Lan <dlan@kernel.org> writes: > > > Add a compatible string for the I2C controller found in SpacemiT K3 SoC > > which use same I2C IP as K1, so make it fallback to K1 compatible. > > > > If is the same IP as K1, shouldn't the "spacemit,k1-i2c" compatible be > used in the k3.dtsi instead? My understanding is that this is the meaning > of compatible, and there's no need to add another compatible string for k3. Your understanding is incorrect! What Yixun has done here is what we want people to do, because even if the IP is the same there can be differences due to integration that are problematic. Having a device specific compatible allows us to handle these kinds of problems if they crop up in the future.
Conor Dooley <conor@kernel.org> writes: Hello Conor, > On Wed, Mar 25, 2026 at 02:20:13PM +0100, Javier Martinez Canillas wrote: >> Yixun Lan <dlan@kernel.org> writes: >> >> > Add a compatible string for the I2C controller found in SpacemiT K3 SoC >> > which use same I2C IP as K1, so make it fallback to K1 compatible. >> > >> >> If is the same IP as K1, shouldn't the "spacemit,k1-i2c" compatible be >> used in the k3.dtsi instead? My understanding is that this is the meaning >> of compatible, and there's no need to add another compatible string for k3. > > Your understanding is incorrect! What Yixun has done here is what we > want people to do, because even if the IP is the same there can be > differences due to integration that are problematic. Having a device > specific compatible allows us to handle these kinds of problems if they > crop up in the future. Thanks for the clarification! It seems the convention changed over the years then. -- Best regards, Javier Martinez Canillas Core Platforms Red Hat
On Wed Mar 25, 2026 at 5:49 PM CST, Yixun Lan wrote: > Add a compatible string for the I2C controller found in SpacemiT K3 SoC > which use same I2C IP as K1, so make it fallback to K1 compatible. > > Signed-off-by: Yixun Lan <dlan@kernel.org> > --- > Documentation/devicetree/bindings/i2c/spacemit,k1-i2c.yaml | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/Documentation/devicetree/bindings/i2c/spacemit,k1-i2c.yaml b/Documentation/devicetree/bindings/i2c/spacemit,k1-i2c.yaml > index 5896fb120501..8c04c675b25e 100644 > --- a/Documentation/devicetree/bindings/i2c/spacemit,k1-i2c.yaml > +++ b/Documentation/devicetree/bindings/i2c/spacemit,k1-i2c.yaml > @@ -14,7 +14,11 @@ allOf: > > properties: > compatible: > - const: spacemit,k1-i2c > + oneOf: > + - items: > + - const: spacemit,k3-i2c > + - const: spacemit,k1-i2c > + - const: spacemit,k1-i2c > > reg: > maxItems: 1 Reviewed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
© 2016 - 2026 Red Hat, Inc.