Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp4240080pxb; Fri, 11 Feb 2022 21:18:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3bFnVvR0rgyaiXG030fGs0b/tnyVygjWdhLEkdtZWmZ36XuMq4xNFH1O0L1uXhdQTaF9H X-Received: by 2002:a17:907:3e16:: with SMTP id hp22mr3860957ejc.710.1644643088167; Fri, 11 Feb 2022 21:18:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644643088; cv=none; d=google.com; s=arc-20160816; b=hIntxyeI79Mtfkm+2xDqsAIJXd2WAXboPaf88TVKwS7SJerhel3yLDMO7TAnxlFS+8 trntreMVFDRaJkSf1tpukMsVi8L+tJ0X3OgmEbVKuER/bI/YSZ8nmZuXyfH6reDiEqYe hOCueqMiWmXs+JovYJfShHlsSNyL09YV58tZ0i+odB13y5sI2cOsnqzQ9wKSY7L3E6Ec 8BVN5tJfUfnFNCRq8/A96yd14SxTY0f864USGUsC+N3JuM8qM3g5AmFKmCdVay2IzM6O aJo7o1mjyQ4h+bBQwe8eCA8AhWAGrItw9WUJ/Ulio3g42pLUY5CK3gue1hw16lL9s9bT UXVg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :message-id:date:cc:to:from:dkim-signature; bh=1n07FGJBspLGZL5CXbur46zxCB6JOx/ZWd3JGbPczPE=; b=RsYvsNBMKSHFRbGMMqkCipsY/6zJ9WGD5vvKobUB6IYWTVNVPlAWhNDpId9HfzaR6O PiOEGBHuhNN55k8H/FjuaPSteBZSz8z97D1SZMyQs1DqOLbTK98lnY40V6C92W6NCY1X 1u0JSlZKRwjxJg5W3gP0xZFcp2wae4H4ezCk4v1HxQq0qjNKMe+t4x2B/vBBr35fpFyF YnV9NVC6RI3vyZmNW018SQpiPl1Sh7RQD20d9M1WGlTjQS+4F1/qnXwH9efcC6Uoiv8h Awn52XR1VYqS6YDZrs8lIQM2lBfIgBr2SsiWVQFdfa3VNsXZmuOxhtdFQslBpdbFfQq7 jyIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=VOrGM09B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg20si3185994ejc.494.2022.02.11.21.16.58; Fri, 11 Feb 2022 21:18:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=VOrGM09B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237389AbiBKPjB (ORCPT + 93 others); Fri, 11 Feb 2022 10:39:01 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231338AbiBKPi7 (ORCPT ); Fri, 11 Feb 2022 10:38:59 -0500 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C0EC13A; Fri, 11 Feb 2022 07:38:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To :From:Sender:Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=1n07FGJBspLGZL5CXbur46zxCB6JOx/ZWd3JGbPczPE=; b=V OrGM09Bk1nDxlN3lE8TOoakvExcTCFoI852CVxjr98QDbEccBfX4FDH6avcE0TkZ+k4O8tVuxTPfg yiV13szUbthBnziQEodYmU70KVP7mJOJB630sOpHMgtEQid7obooR+1rP3ecRYK4U7NzTjn2rrj1G t3ATznZQ5Kt/fLpI=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:55258 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1nIY0Z-0003z0-8D; Fri, 11 Feb 2022 10:38:52 -0500 From: Hugo Villeneuve To: Rob Herring , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team Cc: hugo@hugovil.com, Hugo Villeneuve , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Fri, 11 Feb 2022 10:38:43 -0500 Message-Id: <20220211153843.3721618-1-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH] arm64: dts: imx8mp-evk: add support for I2C5 X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hugo Villeneuve Add support for i2c5, which is used to access the external I2C bus on connector J22 of the imx8mp-evk. Limit the speed to 100kHz since this is an external I2C bus. Disabled by default, since it is shared with the CAN1 bus. To enable i2c5, you need to disable the CAN1 function, enable the i2c5 function and also configure the CAN1/I2C5_SEL GPIO to HIGH to select i2c5 instead of CAN1. This can be done by defining a gpio-hog inside the pca6416 node, in your board device tree, like in this example: &flexcan1 { status = "disabled"; }; &i2c5 { status = "okay"; }; &pca6416 { can1-i2c5-sel-hog { gpio-hog; gpios = <2 GPIO_ACTIVE_HIGH>; output-high; line-name = "can1-i2c5-sel"; }; }; Signed-off-by: Hugo Villeneuve --- arch/arm64/boot/dts/freescale/imx8mp-evk.dts | 22 ++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts index a82c31dbdbf3..4c3ac4214a2c 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-evk.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-evk.dts @@ -319,6 +319,21 @@ pca6416: gpio@20 { }; }; +/* I2C on expansion connector J22. */ +&i2c5 { + clock-frequency = <100000>; /* Lower clock speed for external bus. */ + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c5>; + status = "disabled"; /* can1 pins conflict with i2c5 */ + + /* GPIO 2 of PCA6416 is used to switch between CAN1 and I2C5 functions: + * LOW: CAN1 (default, pull-down) + * HIGH: I2C5 + * You need to set it to high to enable I2C5 (for example, add gpio-hog + * in pca6416 node). + */ +}; + &snvs_pwrkey { status = "okay"; }; @@ -464,6 +479,13 @@ MX8MP_IOMUXC_I2C3_SDA__I2C3_SDA 0x400001c3 >; }; + pinctrl_i2c5: i2c5grp { + fsl,pins = < + MX8MP_IOMUXC_SPDIF_RX__I2C5_SDA 0x400001c3 + MX8MP_IOMUXC_SPDIF_TX__I2C5_SCL 0x400001c3 + >; + }; + pinctrl_pmic: pmicgrp { fsl,pins = < MX8MP_IOMUXC_GPIO1_IO03__GPIO1_IO03 0x000001c0 -- 2.30.2