Re: [PATCH v3] ARM: dts: bcm2711-rpi-cm4-io: Add rtc on a pinctrl-muxed i2c bus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Uwe,

Thanks for the patch !

On 31/12/2021 12:51, Uwe Kleine-König wrote:
The cm4-io board comes with an PCF85063. Add it to the device tree to make
it usable. The i2c0 bus can use two different pinmux settings to use
different pins. To keep the bus appearing on the usual pin pair (gpio0 +
gpio1) use a pinctrl-muxed setting as the vendor dts does.

Note that if you modified the dts before to add devices to the i2c bus
appearing on pins gpio0 + gpio1 (either directly in the dts or using an
overlay), you have to put these into the i2c@0 node introduced here now.

Reviewed-by: Maxime Ripard <maxime@xxxxxxxxxx>
Signed-off-by: Uwe Kleine-König <uwe@xxxxxxxxxxxxxxxxx>
---
Hello,

changes since v2 (20211216212948.nrfmm4jpbhoknfr5@xxxxxxxxxxxxxx):

  - add Maxime's R-b tag
  - change the commit log wording to say vendor dts instead of upstream
    dts
  - Add a paragraph to the commit log about breakage this commits
    introduces.

Best regards
Uwe

  arch/arm/boot/dts/bcm2711-rpi-cm4-io.dts | 35 ++++++++++++++++++++++++
  1 file changed, 35 insertions(+)

diff --git a/arch/arm/boot/dts/bcm2711-rpi-cm4-io.dts b/arch/arm/boot/dts/bcm2711-rpi-cm4-io.dts
index 19600b629be5..5ddad146b541 100644
--- a/arch/arm/boot/dts/bcm2711-rpi-cm4-io.dts
+++ b/arch/arm/boot/dts/bcm2711-rpi-cm4-io.dts
@@ -18,6 +18,41 @@ led-pwr {
  			linux,default-trigger = "default-on";
  		};
  	};
+
+	i2c0mux {
+		compatible = "i2c-mux-pinctrl";
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		i2c-parent = <&i2c0>;
+
+		pinctrl-names = "i2c0", "i2c0-vc";
+		pinctrl-0 = <&i2c0_gpio0>;
+		pinctrl-1 = <&i2c0_gpio44>;
+
+		i2c@0 {
+			reg = <0>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
+
+		i2c@1 {
+			reg = <1>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			rtc@51 {
+				/* Attention: An alarm resets the machine */
+				compatible = "nxp,pcf85063";
+				reg = <0x51>;
+			};
+		};
+	};
+};

This is also needed for camera and display support.
I tested it successfully with imx219 + unicam on mainline.

+
+&i2c0 {
+	/delete-property/ pinctrl-names;
+	/delete-property/ pinctrl-0;
  };
&ddc0 {

base-commit: fc74e0a40e4f9fd0468e34045b0c45bba11dcbb2




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux