Skip to contentSkip to conversation

arm64: dts: rockchip: Enable i2c2 on Orange Pi 3B

PATCH Applied Michael Opdenacker 3 participants 4 messages Nov 20, 2025 – Nov 26, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: dts: rockchip: Enable i2c2 on Orange Pi 3B

Enable the "i2c2" bus on header pins 3 (I2C_SDA_M1) and 5 (I2C2_SCL_M1) of the Orange Pi 3B board.

As documented on http://www.orangepi.org/img/pi3b/0719-pi3b-19.png,
such pins are the only ones offering I2C functionality without conflicting with other SoC blocks.

---
 arch/arm64/boot/dts/rockchip/rk3566-orangepi-3b.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/rockchip/rk3566-orangepi-3b.dtsi +5 -0
index d539570f531e..e2f0ccc6dbe7 100644
@@ -435,6 +435,11 @@ regulator-state-mem {
 	};
 };
 
+&i2c2 {
+	pinctrl-0 = <&i2c2m1_xfer>;
+	status = "okay";
+};
+
 &i2s0_8ch {
 	status = "okay";
 };

---
base-commit: 8e621c9a337555c914cf1664605edfaa6f839774
change-id: 20251120-orangepi3-enable-i2c2-fe6d25ec681a

Best regards,

Signature · 1 line
Michael Opdenacker <[email protected]>
maintainer Applied
#1 lore raw
Quoted 8 lines · Michael Opdenacker

Enable the "i2c2" bus on header pins 3 (I2C_SDA_M1) and 5 (I2C2_SCL_M1) of the Orange Pi 3B board.

As documented on http://www.orangepi.org/img/pi3b/0719-pi3b-19.png,
such pins are the only ones offering I2C functionality without conflicting with other SoC blocks.

[...]

Applied, thanks!

[1/1] arm64: dts: rockchip: Enable i2c2 on Orange Pi 3B

      commit: b92c4eae75468d5b7ad49fc0d1de76a7f0fa0bdb

Best regards,

Signature · 1 line
Heiko Stuebner <[email protected]>
#2 lore raw
In reply to Michael Opdenacker

Hi Michael,

Quoted 6 lines · Michael Opdenacker

Enable the "i2c2" bus on header pins 3 (I2C_SDA_M1) and 5 (I2C2_SCL_M1) of the Orange Pi 3B board.

As documented on http://www.orangepi.org/img/pi3b/0719-pi3b-19.png
such pins are the only ones offering I2C functionality without conflicting with other SoC blocks.

This is strictly not true, these pins are by default used as GPIO, this patch change them to use the I2C2 func, something that should normally be enabled in an overlay.

Functions for these pins:

	func 0		func 1

	GPIO4_B4_d	I2C2_SDA_M1
	GPIO4_B5_d	I2C2_SCL_M1
Quoted 11 lines
---
 arch/arm64/boot/dts/rockchip/rk3566-orangepi-3b.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/rockchip/rk3566-orangepi-3b.dtsi +0 -0
index d539570f531e..e2f0ccc6dbe7 100644

arch/arm64/boot/dts/rockchip/rk3566-orangepi-3b.dtsi regulator-state-mem { · line 439

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk3566-orangepi-3b.dtsi +2 -0
@@ -435,6 +435,11 @@ regulator-state-mem {
 	};
 };
 
+&i2c2 {
+	pinctrl-0 = <&i2c2m1_xfer>;

pinctrl-names should also be added here.

arch/arm64/boot/dts/rockchip/rk3566-orangepi-3b.dtsi regulator-state-mem { · line 440

Quoted 1 line
arch/arm64/boot/dts/rockchip/rk3566-orangepi-3b.dtsi +1 -0
+	status = "okay";

As mentioned above, this should be enabled in an DT overlay not in the board DT.

Regards,
Jonas

Quoted 11 lines
arch/arm64/boot/dts/rockchip/rk3566-orangepi-3b.dtsi +2 -1
+};
+
 &i2s0_8ch {
 	status = "okay";
 };
 
---

base-commit: 8e621c9a337555c914cf1664605edfaa6f839774
change-id: 20251120-orangepi3-enable-i2c2-fe6d25ec681a

Best regards,

_______________________________________________
Linux-rockchip mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-rockchip

#3 lore raw

Hi Jonas

Thanks for the review!

Quoted 13 lines · Jonas Karlman

Hi Michael,

Quoted 6 lines · Michael Opdenacker

Enable the "i2c2" bus on header pins 3 (I2C_SDA_M1) and 5 (I2C2_SCL_M1) of the Orange Pi 3B board.

As documented on http://www.orangepi.org/img/pi3b/0719-pi3b-19.png
such pins are the only ones offering I2C functionality without conflicting with other SoC blocks.

This is strictly not true, these pins are by default used as GPIO, this patch change them to use the I2C2 func, something that should normally be enabled in an overlay.

Quoted 6 lines

Functions for these pins:

	func 0		func 1

	GPIO4_B4_d	I2C2_SDA_M1
	GPIO4_B5_d	I2C2_SCL_M1

Correct. My idea was that GPIOs are easy to get on other pins, and I found that I2C2 on such pins would be a convenient default.

Quoted 14 lines
Quoted 14 lines
---
  arch/arm64/boot/dts/rockchip/rk3566-orangepi-3b.dtsi | 5 +++++
  1 file changed, 5 insertions(+)
arch/arm64/boot/dts/rockchip/rk3566-orangepi-3b.dtsi +0 -0
index d539570f531e..e2f0ccc6dbe7 100644
@@ -435,6 +435,11 @@ regulator-state-mem {
  	};
  };
 
Quoted 3 lines

arch/arm64/boot/dts/rockchip/rk3566-orangepi-3b.dtsi regulator-state-mem { · line 439

Quoted 2 lines
arch/arm64/boot/dts/rockchip/rk3566-orangepi-3b.dtsi +2 -0
+&i2c2 {
+	pinctrl-0 = <&i2c2m1_xfer>;

pinctrl-names should also be added here.

Actually, the "pinctrl-names" property is already available in the definition of i2c2. That's why I didn't add it again.

Quoted 4 lines

arch/arm64/boot/dts/rockchip/rk3566-orangepi-3b.dtsi regulator-state-mem { · line 440

Quoted 2 lines
arch/arm64/boot/dts/rockchip/rk3566-orangepi-3b.dtsi +1 -0
+	status = "okay";

As mentioned above, this should be enabled in an DT overlay not in the board DT.

I don't mind if my patch is removed, no hard feelings :)

BTW, is there a convenient location for sharing overlays like these? Some overlays are sometimes tricky to develop, and sharing them with others is useful for the community.  I guess the question was asked before, but I don't know its answer :)

Thanks again
Cheers
Michael.

Signature · 4 lines
Michael Opdenacker
Root Commit
Yocto Project and OpenEmbedded Training course - Learn by doing:
https://rootcommit.com/training/yocto/