All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-media@vger.kernel.org
Cc: "Uwe Kleine-König" <uwe@kleine-koenig.org>,
	"Dave Stevenson" <dave.stevenson@raspberrypi.com>,
	"David Plowman" <david.plowman@raspberrypi.com>,
	"Jean-Michel Hautbois" <jeanmichel.hautbois@yoseli.org>,
	"Hans Verkuil" <hverkuil-cisco@xs4all.nl>,
	"Naushir Patuck" <naush@raspberrypi.com>,
	"Sakari Ailus" <sakari.ailus@linux.intel.com>,
	kernel-list@raspberrypi.com,
	linux-rpi-kernel@lists.infradead.org,
	"Florian Fainelli" <florian.fainelli@broadcom.com>,
	"Ray Jui" <rjui@broadcom.com>,
	"Scott Branden" <sbranden@broadcom.com>,
	bcm-kernel-feedback-list@broadcom.com,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	devicetree@vger.kernel.org
Subject: [PATCH v8 07/10] ARM: dts: bcm2711-rpi: Add pinctrl-based multiplexing for I2C0
Date: Wed, 27 Mar 2024 02:05:05 +0200	[thread overview]
Message-ID: <20240327000510.2541-8-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <20240327000510.2541-1-laurent.pinchart@ideasonboard.com>

From: Uwe Kleine-König <uwe@kleine-koenig.org>

BCM2711-based Raspberry Pi boards (4B, CM4 and 400) multiplex the I2C0
controller over two sets of pins, GPIO0+1 and GPIO44+45. The former is
exposed on the 40-pin header, while the latter is used for the CSI and
DSI connectors.

Add a pinctrl-based I2C bus multiplexer to bcm2711-rpi.dtsi to model
this multiplexing. The two child buses are named i2c0_0 and i2c0_1.

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 i2c0_0 node introduced here
now.

Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
Changes since v7:

- Rename i2c0mux to i2c-mux0

Changes since v6:

- Don't disable i2c0mux by default

Changes since v3:

- Split addition of the RTC to a separate patch
- Move the mux to bcm2711-rpi.dtsi
---
 arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi | 29 +++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi b/arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi
index 86188eabeb24..6bf4241fe3b7 100644
--- a/arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi
+++ b/arch/arm/boot/dts/broadcom/bcm2711-rpi.dtsi
@@ -17,6 +17,30 @@ aliases {
 		pcie0 = &pcie0;
 		blconfig = &blconfig;
 	};
+
+	i2c0mux: i2c-mux0 {
+		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>;
+
+		i2c0_0: i2c@0 {
+			reg = <0>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
+
+		i2c0_1: i2c@1 {
+			reg = <1>;
+			#address-cells = <1>;
+			#size-cells = <0>;
+		};
+	};
 };
 
 &firmware {
@@ -49,6 +73,11 @@ &hvs {
 	clocks = <&firmware_clocks 4>;
 };
 
+&i2c0 {
+	/delete-property/ pinctrl-names;
+	/delete-property/ pinctrl-0;
+};
+
 &rmem {
 	/*
 	 * RPi4's co-processor will copy the board's bootloader configuration
-- 
Regards,

Laurent Pinchart


  parent reply	other threads:[~2024-03-27  0:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27  0:04 [PATCH v8 00/10] media: Add driver for the Raspberry Pi <5 CSI-2 receiver Laurent Pinchart
2024-03-27  0:04 ` [PATCH v8 01/10] media: v4l: Add V4L2-PIX-FMT-Y12P format Laurent Pinchart
2024-03-27  0:05 ` [PATCH v8 02/10] media: v4l: Add V4L2-PIX-FMT-Y14P format Laurent Pinchart
2024-03-27  0:05 ` [PATCH v8 03/10] dt-bindings: media: Add bindings for bcm2835-unicam Laurent Pinchart
2024-03-27  0:05 ` [PATCH v8 04/10] media: bcm2835-unicam: Add support for CCP2/CSI2 camera interface Laurent Pinchart
2024-03-27  0:05 ` [PATCH v8 05/10] ARM: dts: bcm2835-rpi: Move firmware-clocks from bcm2711 to bcm2835 Laurent Pinchart
2024-03-27 14:46   ` Dave Stevenson
2024-03-27  0:05 ` [PATCH v8 06/10] ARM: dts: bcm2835: Add Unicam CSI nodes Laurent Pinchart
2024-03-27  0:05 ` Laurent Pinchart [this message]
2024-03-27  0:05 ` [PATCH v8 08/10] ARM: dts: bcm2711-rpi-cm4-io: Add RTC on I2C0 Laurent Pinchart
2024-03-27  0:05 ` [PATCH v8 09/10] ARM: dts: bcm2711-rpi-4-b: Add CAM1 regulator Laurent Pinchart
2024-03-27 14:49   ` Dave Stevenson
2024-03-27  0:05 ` [PATCH v8 10/10] [DNI] arm64: dts: broadcom: Add overlay for Raspberry Pi 4B IMX219 camera Laurent Pinchart
2024-03-27  0:12 ` [PATCH v8 00/10] media: Add driver for the Raspberry Pi <5 CSI-2 receiver Laurent Pinchart
2024-03-27 14:54   ` Dave Stevenson

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=20240327000510.2541-8-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=conor+dt@kernel.org \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=david.plowman@raspberrypi.com \
    --cc=devicetree@vger.kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jeanmichel.hautbois@yoseli.org \
    --cc=kernel-list@raspberrypi.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=naush@raspberrypi.com \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=sbranden@broadcom.com \
    --cc=uwe@kleine-koenig.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.