From patchwork Mon Jun 12 18:24:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9782649 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 A0B3E60352 for ; Mon, 12 Jun 2017 18:33:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8339527F81 for ; Mon, 12 Jun 2017 18:33:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 76168286B0; Mon, 12 Jun 2017 18:33:28 +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=-1.9 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 17B7027F81 for ; Mon, 12 Jun 2017 18:33:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=SnCYfHNwzMlJohaAH2+qDZ6NDTV3DLTZDC0proCQfLw=; b=jHZn+8c7miX+3O7gDy2zKLp8I6 ZLBXTZGdOu8j71ROh4ufsqt439ZL2vmOwLdueB6O4diy7QUJlk5AhvUZoycRfd236GDq/S9F4TuS2 0SabxUX4vZZqWeFPLBoxwkAjWYqQx1sIBU5l8Hw9PFHbUYzQoSogYCngj9HJz8T1P8hm2fwYsRJzu SN9xS3PjH53Vgmm2Fi3rpMkMevfZj/B2gqUxIEGThnkXoiXL+3b3xVdHVJOp9qhzNZOnNFxap7T6/ vFLFzfi4irBnbbzynDC1bykcoDAinyHa8RkqXv5n50zwRgm5mQ/IO8eM/gkamUZc8o0XmNwQb6siD /SpBGdYg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dKU9S-0002Wi-3t; Mon, 12 Jun 2017 18:33:22 +0000 Received: from mail-pg0-x244.google.com ([2607:f8b0:400e:c05::244]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dKU18-0004e3-VA for linux-arm-kernel@lists.infradead.org; Mon, 12 Jun 2017 18:24:49 +0000 Received: by mail-pg0-x244.google.com with SMTP id v14so15027890pgn.1 for ; Mon, 12 Jun 2017 11:24:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=fZPexNgIq537/akd3Hd35sOoc5yoENWSfCb8Zb9FXTA=; b=TgXTfyHtaWqInifVTnnc1UHR9NBs3iDCl+y9CMpZbUL+RBZ6B+CgX32jHLpt9IiUU9 AB+7PU6z6+AuLbnimzI/aWGakyTIP37W4E0b0s+OdnejEilg5XFEw1EbLJP0Uh/ukyFU sdG9jonNBkva+L9MhTID3WqAlL+KjG861wlLziFdHC1Ky1l8QU2xN2queuCuEXuiOrKY MBn8o6Dt0PQ3Daqp+s5pX+k2WNSLLFNEGZSOl4q2YS/uAfHTAzXMrrOvJmnkigcGNQ7q uZdFwDv/DAu6qpDmK3Krk++aPiAiDh1q9/FdRQ9t04nd8wmz4l89tbQdJ03FvpIZHCsD 8GdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=fZPexNgIq537/akd3Hd35sOoc5yoENWSfCb8Zb9FXTA=; b=CVNgHKDxfm7JKQ6Gllxq9K3zSDpgDB7hVtDaYUhBDgM4crT24ZWz1CkUbIyStFE83M i02DI+avhinuTD5SEQa5m/r8XiWyfh52jV+kncS3Jx+XVFIav2EO/9ctq0Z1mRE7LbYG 15Pl+qh7KRetM2fUeBPd9uZO4R8X0yaNRUFYCIlJiod9StfuooOpGZvcIGPhmMDNbag+ oecy2LJ8lXB0CCjJUUbYP17jjFKAitKAMii6+xwbUGcqzMDD2w5uKY3Ilp2esHsMdapU 1vw/vXXKSbzVFIHegVWSlKdGGowU7MuS/dJf889sCFwrI67I+YhLhB3dhcqZr8AHcfLd qMBg== X-Gm-Message-State: AODbwcAsu00z2Xa7ItLWw9w00ioSCKfHVFPb+vs3ihDOl4O7Y7YbnNge NbF6jPM2X9BYDQ== X-Received: by 10.84.184.12 with SMTP id l12mr39629419plc.296.1497291866165; Mon, 12 Jun 2017 11:24:26 -0700 (PDT) Received: from mappy.sklembedded.com (c-98-210-181-167.hsd1.ca.comcast.net. [98.210.181.167]) by smtp.googlemail.com with ESMTPSA id s131sm19394026pgs.6.2017.06.12.11.24.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 12 Jun 2017 11:24:25 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: Shawn Guo , Sascha Hauer , Fabio Estevam , Rob Herring , Mark Rutland , Russell King Subject: [PATCH 08/11] ARM: dts: imx6-sabreauto: create i2cmux for i2c3 Date: Mon, 12 Jun 2017 11:24:01 -0700 Message-Id: <1497291844-14632-9-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1497291844-14632-1-git-send-email-steve_longerbeam@mentor.com> References: <1497291844-14632-1-git-send-email-steve_longerbeam@mentor.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170612_112447_469634_D7966016 X-CRM114-Status: GOOD ( 12.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Steve Longerbeam , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 a2a714d..c8e35c4 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 0x0b0b1 + >; + }; + pinctrl_pwm3: pwm1grp { fsl,pins = < MX6QDL_PAD_SD4_DAT1__PWM3_OUT 0x1b0b1