public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Detlev Casanova <detlev.casanova@collabora.com>
To: linux-kernel@vger.kernel.org
Cc: arnd@arndb.de, bcm-kernel-feedback-list@broadcom.com,
	devicetree@vger.kernel.org, f.fainelli@gmail.com,
	frowand.list@gmail.com, linux-arm-kernel@lists.infradead.org,
	linux-rpi-kernel@lists.infradead.org, masahiroy@kernel.org,
	michal.lkml@markovi.net, ndesaulniers@google.com,
	nsaenz@kernel.org, olof@lixom.net, rjui@broadcom.com,
	robh+dt@kernel.org, sbranden@broadcom.com, soc@kernel.org,
	stefan.wahren@i2se.com,
	Detlev Casanova <detlev.casanova@collabora.com>
Subject: [RFC PATCH v2 1/3] ARM: dts: bcm2*: Demux i2c0 with a pinctrl
Date: Wed, 27 Apr 2022 14:52:41 -0400	[thread overview]
Message-ID: <20220427185243.173594-2-detlev.casanova@collabora.com> (raw)
In-Reply-To: <20220427185243.173594-1-detlev.casanova@collabora.com>

The i2c0 device has 2 different busses controlled by a pinctrl.
This commit separates the device node into 2 i2c devices:
 * pin 0: Base i2c bus
 * pin 44: DSI i2c bus

i2c0 is renamed to i2c0if so that device-trees referencing i2c0 don't
break and use the i2c0 node defined in i2c0mux node.

i2c_csi_dsi can be used to control devices via the DSI i2c bus, used for
DSI displays.

Signed-off-by: Detlev Casanova <detlev.casanova@collabora.com>
---
 arch/arm/boot/dts/bcm2711-rpi-4-b.dts         |  1 +
 arch/arm/boot/dts/bcm2711.dtsi                |  2 +-
 arch/arm/boot/dts/bcm2835-rpi.dtsi            |  9 ++++---
 .../boot/dts/bcm283x-rpi-i2c0mux_0_44.dtsi    |  4 +++
 arch/arm/boot/dts/bcm283x.dtsi                | 26 ++++++++++++++++++-
 5 files changed, 37 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/boot/dts/bcm283x-rpi-i2c0mux_0_44.dtsi

diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
index 4432412044de..5dcce58817e6 100644
--- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
+++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts
@@ -4,6 +4,7 @@
 #include "bcm2711-rpi.dtsi"
 #include "bcm283x-rpi-usb-peripheral.dtsi"
 #include "bcm283x-rpi-wifi-bt.dtsi"
+#include "bcm283x-rpi-i2c0mux_0_44.dtsi"
 
 / {
 	compatible = "raspberrypi,4-model-b", "brcm,bcm2711";
diff --git a/arch/arm/boot/dts/bcm2711.dtsi b/arch/arm/boot/dts/bcm2711.dtsi
index dff18fc9a906..96209ed89c36 100644
--- a/arch/arm/boot/dts/bcm2711.dtsi
+++ b/arch/arm/boot/dts/bcm2711.dtsi
@@ -1045,7 +1045,7 @@ &cma {
 	alloc-ranges = <0x0 0x00000000 0x40000000>;
 };
 
-&i2c0 {
+&i2c0if {
 	compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c";
 	interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>;
 };
diff --git a/arch/arm/boot/dts/bcm2835-rpi.dtsi b/arch/arm/boot/dts/bcm2835-rpi.dtsi
index 87ddcad76083..1e38f9f0e80e 100644
--- a/arch/arm/boot/dts/bcm2835-rpi.dtsi
+++ b/arch/arm/boot/dts/bcm2835-rpi.dtsi
@@ -49,13 +49,16 @@ alt0: alt0 {
 	};
 };
 
-&i2c0 {
-	pinctrl-names = "default";
-	pinctrl-0 = <&i2c0_gpio0>;
+&i2c0if {
 	status = "okay";
 	clock-frequency = <100000>;
 };
 
+&i2c0mux {
+	pinctrl-0 = <&i2c0_gpio0>;
+	status = "okay";
+};
+
 &i2c1 {
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c1_gpio2>;
diff --git a/arch/arm/boot/dts/bcm283x-rpi-i2c0mux_0_44.dtsi b/arch/arm/boot/dts/bcm283x-rpi-i2c0mux_0_44.dtsi
new file mode 100644
index 000000000000..119946d878db
--- /dev/null
+++ b/arch/arm/boot/dts/bcm283x-rpi-i2c0mux_0_44.dtsi
@@ -0,0 +1,4 @@
+&i2c0mux {
+	pinctrl-0 = <&i2c0_gpio0>;
+	pinctrl-1 = <&i2c0_gpio44>;
+};
diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
index c113661a6668..62d7ee513549 100644
--- a/arch/arm/boot/dts/bcm283x.dtsi
+++ b/arch/arm/boot/dts/bcm283x.dtsi
@@ -336,7 +336,7 @@ spi: spi@7e204000 {
 			status = "disabled";
 		};
 
-		i2c0: i2c@7e205000 {
+		i2c0if: i2c@7e205000 {
 			compatible = "brcm,bcm2835-i2c";
 			reg = <0x7e205000 0x200>;
 			interrupts = <2 21>;
@@ -346,6 +346,30 @@ i2c0: i2c@7e205000 {
 			status = "disabled";
 		};
 
+		i2c0mux: i2c0mux {
+			compatible = "i2c-mux-pinctrl";
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			i2c-parent = <&i2c0if>;
+
+			pinctrl-names = "i2c0", "i2c_csi_dsi";
+
+			status = "disabled";
+
+			i2c0: i2c@0 {
+				reg = <0>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+
+			i2c_csi_dsi: i2c@1 {
+				reg = <1>;
+				#address-cells = <1>;
+				#size-cells = <0>;
+			};
+		};
+
 		dpi: dpi@7e208000 {
 			compatible = "brcm,bcm2835-dpi";
 			reg = <0x7e208000 0x8c>;
-- 
2.36.0


  reply	other threads:[~2022-04-27 19:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27 18:52 [RFC PATCH v2 0/3] ARM: dts: Support official Raspberry Pi 7inch touchscreen Detlev Casanova
2022-04-27 18:52 ` Detlev Casanova [this message]
2022-04-27 18:52 ` [RFC PATCH v2 2/3] of: Add support for -@ when compiling overlays Detlev Casanova
2022-04-27 21:24   ` Rob Herring
2022-04-28  0:01     ` Florian Fainelli
2022-04-27 18:52 ` [RFC PATCH v2 3/3] ARM: dto: Add bcm2711-rpi-7-inches-ts.dts overlay Detlev Casanova
2022-04-27 21:16   ` Rob Herring
2022-04-28  6:44     ` Geert Uytterhoeven
2022-04-28 14:26       ` Rob Herring
  -- strict thread matches above, loose matches on Subject: below --
2022-02-21 14:01 [RFC PATCH v2 0/3] ARM: dts: Support official Raspberry Pi 7inch touchscreen Detlev Casanova
2022-02-21 14:01 ` [RFC PATCH v2 1/3] ARM: dts: bcm2*: Demux i2c0 with a pinctrl Detlev Casanova

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220427185243.173594-2-detlev.casanova@collabora.com \
    --to=detlev.casanova@collabora.com \
    --cc=arnd@arndb.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=frowand.list@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=masahiroy@kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=ndesaulniers@google.com \
    --cc=nsaenz@kernel.org \
    --cc=olof@lixom.net \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=soc@kernel.org \
    --cc=stefan.wahren@i2se.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox