From patchwork Tue Jun 14 22:49:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9177127 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 1A4F36021C for ; Tue, 14 Jun 2016 22:52:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0AE8C28338 for ; Tue, 14 Jun 2016 22:52:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F41F82833E; Tue, 14 Jun 2016 22:52:22 +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=ham 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 9BDAD28338 for ; Tue, 14 Jun 2016 22:52:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932313AbcFNWwS (ORCPT ); Tue, 14 Jun 2016 18:52:18 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:34724 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932111AbcFNWvU (ORCPT ); Tue, 14 Jun 2016 18:51:20 -0400 Received: by mail-pf0-f196.google.com with SMTP id 66so306265pfy.1 for ; Tue, 14 Jun 2016 15:51:20 -0700 (PDT) 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=mobOEAHZ0H9c1P5XX+01V2D4e/8zmoDMHx+benimX3o=; b=IFOfsrikSRQWru9gbOzarEVyPqYHu6wNjvaquVTITk95gEe1QoST39qAWCqjZxw99l Uv8aNHmuJPa0jRNoA6kDXZrMR/0ZYjz4RnETUq7J7MDgcg3nW8izjIctVeTSWVpvI7Tq 1byOvnst1+WgWrHRzopq3oKeHIjs+AXOgYw5LAE1qcs4+EC8/+Vcnc5if+ztFL8evSuT 4AkiFC483M81NUzJhGkzIq5IlzlO0NGsP4wrLRw/isNtMIptUoi1NXad5HRiE0+R4SHu T6+SNuPgn3n25ZOLIFFeu5CXXIuoIX01Fz3CZzIGKsmZ/jJ5XQ8i2CIJ1SoHa4prY4vT WQKQ== 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=mobOEAHZ0H9c1P5XX+01V2D4e/8zmoDMHx+benimX3o=; b=FhkWSo+UutERVjjmpxq93E6MMIhZuk88NgFLXsRfySE+UvbnfwbNqmi6rXYd+m5Kje /w3HhidQ5YMhOBNfQ81cEJgKTzkT/9wNFrMvXx9BA037j0qfPBEBI3GKUCrZhtrhePMB d1LYysBuSPKcbNLyosYm4z2AMs+eCr60fezIn38rt0OpfQ+iDl/jWgQ6Sniol9YKN7Jy hGNNtFYPRdDTebA97QBZLLSfiHJ0HifqWuZ/hIOUFuhspDrrFbMdMtrAGhB2OPOYNiJb DFMQKcQ/hJ2Cxn2w9G1LqoeXUPtvF0E1lCr06PYrOWYJ1E97StUxo+UhPYR2Yu/poJfl x8aQ== X-Gm-Message-State: ALyK8tK8muPxz4YjMLkvPYNLGAldM8oGPiV0q7MJnkddDj16HRF0C3OXkOO6RpPfmC82/g== X-Received: by 10.98.103.198 with SMTP id t67mr65181pfj.158.1465944679766; Tue, 14 Jun 2016 15:51:19 -0700 (PDT) Received: from mothership.sklembedded.com (c-73-241-2-21.hsd1.ca.comcast.net. [73.241.2.21]) by smtp.googlemail.com with ESMTPSA id v184sm47829999pfb.24.2016.06.14.15.51.19 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 14 Jun 2016 15:51:19 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: linux-media@vger.kernel.org Cc: Steve Longerbeam Subject: [PATCH 21/38] ARM: dts: imx6-sabreauto: create i2cmux for i2c3 Date: Tue, 14 Jun 2016 15:49:17 -0700 Message-Id: <1465944574-15745-22-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1465944574-15745-1-git-send-email-steve_longerbeam@mentor.com> References: <1465944574-15745-1-git-send-email-steve_longerbeam@mentor.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 d354d40..13f50e8 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 { @@ -290,27 +328,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 { @@ -418,6 +435,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