From patchwork Thu Dec 8 00:57:47 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9465523 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5BE4760512 for ; Thu, 8 Dec 2016 01:01:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2466A28565 for ; Thu, 8 Dec 2016 01:01:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18E5E2858A; Thu, 8 Dec 2016 01:01:32 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B025828565 for ; Thu, 8 Dec 2016 01:01:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934088AbcLHBAc (ORCPT ); Wed, 7 Dec 2016 20:00:32 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:33555 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753331AbcLHA7r (ORCPT ); Wed, 7 Dec 2016 19:59:47 -0500 Received: by mail-pf0-f194.google.com with SMTP id 144so21306691pfv.0; Wed, 07 Dec 2016 16:59:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OTI7WQMFLTOG+S3F9MWnD0ZwmIq1fD2nHdo9FWTxQRE=; b=UkB0LkWEo02rcpNdvX7JVjYhKnnYzFSQm2WTMLroAJ5kFbRJSse6/mCv1RYZYO3vYw 2tXcuu0Mx3IjEuYJ3eFcRhONrPkjw3QWEwYICRH56VmHUQnbkjco6CWqkDm6ZKzvIRFt ol3nH0VPoTwsFEY9T7r3rddx6dI+USHgJVtsm/vCUB49x8LUbQzU3NHYjyBKE78ss8wj gQ+hj/hTA4ENju34jBlNY37Q67Aczhb7lUnjSTrfcKoOiSBxHyWSLwZ6b4sqSdV9Lmru nPWeZBRMWXTLfXnw5mE37SI0ir3DqxqZ7JPy9b0HbdRDUQn9lTSoYQjbfPNmi9RyCcjB +lVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=OTI7WQMFLTOG+S3F9MWnD0ZwmIq1fD2nHdo9FWTxQRE=; b=NOuUr8Xzk7IrmXBqCDJ6HEmoFPzh7aNwRI5pwtK/pfPhvyRfujlNNEwmK1Kn2mpGGL WnfNmwIa5oLBee/GpRs8KvMfIa7UmjwG2zSE/xz+Xr63vCxLfFcMozq5JxRHnS13fHrE Ts3Zt35kdhNdAv4syce+WYQAnZFcTKY14azpXmo/a6J85K2BeUOV0h6QrkcQQDKmHJ3e J1RKLRk4i1wHG3I0gIHR/M7xVUMAn3z8r6ApC2jb6GTEm15aIyznELPbmArTR9FDPvRy 4+jXhDs2Ua8TISrpflcLL7PlZM8z1z0/N/wzZvHywFw2lBlIrrEkz0oFx7YXQFE7iBaP 1T1A== X-Gm-Message-State: AKaTC03y7Mj3k9u7H7VMtni/SZrZOGo57vyOcxpceHpNPNHbM+kTjUJNyRfwthiup08NZQ== X-Received: by 10.99.112.66 with SMTP id a2mr125333530pgn.43.1481158773698; Wed, 07 Dec 2016 16:59:33 -0800 (PST) Received: from majic.sklembedded.com (c-73-241-2-21.hsd1.ca.comcast.net. [73.241.2.21]) by smtp.googlemail.com with ESMTPSA id n25sm45265872pfi.33.2016.12.07.16.59.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Dec 2016 16:59:32 -0800 (PST) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: shawnguo@kernel.org, kernel@pengutronix.de, fabio.estevam@nxp.com, robh+dt@kernel.org, mark.rutland@arm.com, linux@armlinux.org.uk, tomi.valkeinen@ti.com, p.zabel@pengutronix.de Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Steve Longerbeam Subject: [PATCH 06/12] ARM: dts: imx6-sabreauto: create i2cmux for i2c3 Date: Wed, 7 Dec 2016 16:57:47 -0800 Message-Id: <1481158673-15937-7-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1481158673-15937-1-git-send-email-steve_longerbeam@mentor.com> References: <1481158673-15937-1-git-send-email-steve_longerbeam@mentor.com> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The sabreauto uses a steering pin to select between the SDA signal on i2c3 bus, and a data-in pin for an SPI NOR chip. Use i2cmux to control this steering pin. Idle state of the i2cmux selects SPI NOR. This is not a classic way to use i2cmux, since one side of the mux selects something other than an i2c bus, but it works and is probably the cleanest solution. Note that if one thread is attempting to access SPI NOR while another thread is accessing i2c3, the SPI NOR access will fail since the i2cmux has selected the SDA pin rather than SPI NOR data-in. This couldn't be avoided in any case, the board is not designed to allow concurrent i2c3 and SPI NOR functions (and the default device-tree does not enable SPI NOR anyway). Devices hanging off i2c3 should now be defined under i2cmux, so that the steering pin can be properly controlled to access those devices. The port expanders (MAX7310) are thus moved into i2cmux. Signed-off-by: Steve Longerbeam --- arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 65 +++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 21 deletions(-) diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi index e000e6f..043d20c 100644 --- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi @@ -108,6 +108,44 @@ default-brightness-level = <7>; status = "okay"; }; + + i2cmux { + compatible = "i2c-mux-gpio"; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_i2c3mux>; + mux-gpios = <&gpio5 4 0>; + i2c-parent = <&i2c3>; + idle-state = <0>; + + i2c@1 { + #address-cells = <1>; + #size-cells = <0>; + reg = <1>; + + max7310_a: gpio@30 { + compatible = "maxim,max7310"; + reg = <0x30>; + gpio-controller; + #gpio-cells = <2>; + }; + + max7310_b: gpio@32 { + compatible = "maxim,max7310"; + reg = <0x32>; + gpio-controller; + #gpio-cells = <2>; + }; + + max7310_c: gpio@34 { + compatible = "maxim,max7310"; + reg = <0x34>; + gpio-controller; + #gpio-cells = <2>; + }; + }; + }; }; &clks { @@ -291,27 +329,6 @@ pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c3>; status = "okay"; - - max7310_a: gpio@30 { - compatible = "maxim,max7310"; - reg = <0x30>; - gpio-controller; - #gpio-cells = <2>; - }; - - max7310_b: gpio@32 { - compatible = "maxim,max7310"; - reg = <0x32>; - gpio-controller; - #gpio-cells = <2>; - }; - - max7310_c: gpio@34 { - compatible = "maxim,max7310"; - reg = <0x34>; - gpio-controller; - #gpio-cells = <2>; - }; }; &iomuxc { @@ -419,6 +436,12 @@ >; }; + pinctrl_i2c3mux: i2c3muxgrp { + fsl,pins = < + MX6QDL_PAD_EIM_A24__GPIO5_IO04 0x80000000 + >; + }; + pinctrl_pwm3: pwm1grp { fsl,pins = < MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x1b0b1