Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2139261pxb; Wed, 9 Feb 2022 11:40:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmzY0UXrqFuQznDMnh/JStlp/xjCEzhmWrUOjXNhE+vEwZBE964Uh8XH2au6fACNdermtJ X-Received: by 2002:a17:90a:df13:: with SMTP id gp19mr4286914pjb.170.1644435653748; Wed, 09 Feb 2022 11:40:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644435653; cv=none; d=google.com; s=arc-20160816; b=hov0Sb46gebRNLxAxOZFzj4aJYgTonT6kSE/b9NAKeuNbHAAoydKvk24oT0Lk2hjcQ NQ58EqmtF5wkpbHa1UdUNDlMn6BTlmrrKBc/Cp21LtnXHOUtuab9vcA6tVXTTNIaoG1w OwemIEij9fN85mpxfA2ryuEKjdkKciDBt10vjGlon6/nHJSg6i1XEruYKr65WVQTSb1J SytJrgJs0/dAs7VxSK8wKul4bzmMbj/fQQC4h5hi8CAoBryC647Sm9cBdfq8XErK6D91 KNDt9BSLFfTAScsdpPRvaVoDbL3yXbsjDrlh8OwlI99zK/mtvp1dLquRe4ETOaWZFy2P dlZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WuOl2zqIWeORod7LfrDLN9K0yi4pjocJOKBROcjt6JU=; b=kXeL5mtMt8wkoqsOqlrdYN/OLGSk2kCD1QV2xSKtbHKH+jcl6ILXz5sOuvd9D4NKyB 0g6oQFgQU8G8PNrCLh46WJnstIi3mpc+JyF/X9k/h3fxyyy0L7eTueWmGfTWMyWu0KhR LfeuFCTHIMoCmTeQTAHnPIGdc4Xw+HWVTP+06z8MYerIZu8d7ucK39YYhNHbrw2SEcc1 gNLMuJwyrNjyqoYoaWCP80EN7DxfBYDRzAruM6L9YETmLyjBEh/i/kyBhrSIlb1zFB37 UdxCxFLH3LxW0KURICFRbu53AcZkl4JnujkmB4JVi8QgiAf0VyQSvG2A3+oBJJj2aPsR mO9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=YU3f9cxu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f6si6288749pjp.32.2022.02.09.11.40.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 11:40:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=YU3f9cxu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CAD2EE019D2D; Wed, 9 Feb 2022 11:40:38 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236840AbiBIQZn (ORCPT + 99 others); Wed, 9 Feb 2022 11:25:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236836AbiBIQZi (ORCPT ); Wed, 9 Feb 2022 11:25:38 -0500 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2910C05CB98; Wed, 9 Feb 2022 08:25:39 -0800 (PST) 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 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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>; -- 2.35.1