From patchwork Wed Feb 9 16:25:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Detlev Casanova X-Patchwork-Id: 12740439 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B942AC433FE for ; Wed, 9 Feb 2022 16:27:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=eSVQ2qGh72+3PwUWV69eQarMvX+6GggUyIZG/tPJpCU=; b=Y3MpOVrRfaFX7w u5WEcIlkfGQthmBPLNtnJWkGr29ugQhfwBYgF5e7njHLmaFX3rAPYQng52xPahYCVV/DO51No7djW Ooiy+qgvGoaQYYHmEHq32uSfXjBhfkfUZZaPdaxdIoypc6Yr04b2mI0ctG2uSZ94ypb+6HSyVe/3Y IwJ4djK2hPkhUROEglI6a67Ap9Gf49FoC+60/6oHpPzMesrKkRNSeHXqGJ50Lc/JN61uvJl8fTFrS EZbqgDQkMZ87a0wAuuuQyq77GNNdstZKe3T35MwAoGUIs1Uc4S1A+4YnZxcKRl+CpH4ZiXUVk5LYT VA+I0j4UweH/jox6kIDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHpmw-000mwA-Mu; Wed, 09 Feb 2022 16:25:50 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHpmm-000mt3-Gu; Wed, 09 Feb 2022 16:25:42 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: detlev) with ESMTPSA id 5F18F1F437E9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1644423938; bh=pBEyIXjpERGXALEgiE/cj9eaQwG8uWLOPvKmRjcAppI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YU3f9cxu/cubduUwHyPaXqJfmVzO1AIBcw7ukZIUY2PnYUiJc4a6fVTFZmmhAtM/U 3xM1jLqaKpzjA+yO7MriBzSGEcwCE6eKiFdCq9kYM8AaJZrba/YWwzvAb5UvmGucpA XbnFXA5ZkhkJAf4HCnqS8VBl+j0GlLRco7fwatR9Tzy0B1efxmcZPzN4ygD3isokdG KwkEYw04gGc9chNaQNV1GDynM5FJevzxjKB0h6DHJA9SzCiJHRJWtIIzlT2as8PSf5 4TrowIUvpDZja4RiiYuQb6OjoTGtxLopbGrOAslfBMamBk02o6odXK+hf+Hbh0R8mD LppKl0N5NNbhw== From: Detlev Casanova To: linux-kernel@vger.kernel.org Cc: Detlev Casanova , Arnd Bergmann , Olof Johansson , soc@kernel.org (maintainer:ARM AND ARM64 SoC SUB-ARCHITECTURES (COMMON PARTS)), Rob Herring , Nicolas Saenz Julienne , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com (maintainer:BROADCOM BCM281XX/BCM11XXX/BCM216XX ARM ARCHITE...), Stefan Wahren , linux-arm-kernel@lists.infradead.org (moderated list:ARM AND ARM64 SoC SUB-ARCHITECTURES (COMMON PARTS)), devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-rpi-kernel@lists.infradead.org (moderated list:BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE) Subject: [PATCH 1/2] ARM: dts: bcm2*: Demux i2c0 with a pinctrl Date: Wed, 9 Feb 2022 11:25:11 -0500 Message-Id: <20220209162515.706729-2-detlev.casanova@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220209162515.706729-1-detlev.casanova@collabora.com> References: <20220209162515.706729-1-detlev.casanova@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220209_082540_719735_9C9964E4 X-CRM114-Status: GOOD ( 16.38 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- 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 3b60297af7f6..bf6e8251c2c7 100644 --- a/arch/arm/boot/dts/bcm2711.dtsi +++ b/arch/arm/boot/dts/bcm2711.dtsi @@ -1037,7 +1037,7 @@ &cma { alloc-ranges = <0x0 0x00000000 0x40000000>; }; -&i2c0 { +&i2c0if { compatible = "brcm,bcm2711-i2c", "brcm,bcm2835-i2c"; interrupts = ; }; 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 a3e06b680947..06d04cde52b9 100644 --- a/arch/arm/boot/dts/bcm283x.dtsi +++ b/arch/arm/boot/dts/bcm283x.dtsi @@ -334,7 +334,7 @@ spi: spi@7e204000 { status = "disabled"; }; - i2c0: i2c@7e205000 { + i2c0if: i2c@7e205000 { compatible = "brcm,bcm2835-i2c"; reg = <0x7e205000 0x200>; interrupts = <2 21>; @@ -344,6 +344,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>;