From patchwork Wed Jul 6 23:36:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 9217415 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 5211260752 for ; Wed, 6 Jul 2016 23:37:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 45BE12854E for ; Wed, 6 Jul 2016 23:37:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3AC0C2854F; Wed, 6 Jul 2016 23:37:37 +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 D2AD6284E8 for ; Wed, 6 Jul 2016 23:37:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932587AbcGFXhd (ORCPT ); Wed, 6 Jul 2016 19:37:33 -0400 Received: from mail-pa0-f65.google.com ([209.85.220.65]:33749 "EHLO mail-pa0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755811AbcGFXh1 (ORCPT ); Wed, 6 Jul 2016 19:37:27 -0400 Received: by mail-pa0-f65.google.com with SMTP id ts6so155384pac.0 for ; Wed, 06 Jul 2016 16:36:59 -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=pVOc0lXLKoui03q1LNtRWpzY0aMmllPCo6LBupN5uDcizFBBjKNgrzkCjQhlFHyxTx M+SDC1l7qff4faRbD10f4T/CA7Rc9w8Imldh3xQJXhN7QZZ3Z2Yyjq65BcR4EL+C22Id 6HcZuxmNPtItpIxson9aaxDFrwiD321kKIWrQChsHQs5Hx6HqL37BE39yiwR7ckQ9D9T 62mkbFQznykXaMRwMJc+pVjr9I7uQLf2uKCO36l4VM0X6/skVK8t5HhnPJOKuQQ+lhBH vQeom9Rzaf0HGcHsSeibD7AnHhxxeHqn+f8ISHUf5QatnzdiZWdAbsXKpPLyVwwUPM0M ak7Q== 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=dB50ytj5yFmalpjBmZWRJ68mzVY3Rjgp3hEfr1KC03higPkcfKhOmbnxftftb9oDL9 1t12SwG1veQP7xcJiS5qsN82kdvi8GzmVCeW05I5uX9TR23wRmyYozCZVZld9Kz/ujS8 mJF6TGkBApipzE9lfL/hWMAbWeiKBJ4X14geQqUba83VcYivWOfpoYZupdOj9ZMgBfMS V1Ez49ZqwT8OhTiWSW4S0nFj4P50C4PyWF+7BTqFHiG57XwI6qu/Z2nRTphEhNQp6qNP 1gS8kEeeCISKcUpCIATJn8kSDx29X13MVmgG56D0ZKIsQrrq3/3E3Bh3kN0gbOAP8I4x 3uPA== X-Gm-Message-State: ALyK8tI7CdW+q2C9FFB1KsmpCUVxZzrEkAHbbozUF+llaOyeDDjX6PDWw+DSvpQmxFfGRQ== X-Received: by 10.66.158.68 with SMTP id ws4mr16045539pab.144.1467848219334; Wed, 06 Jul 2016 16:36:59 -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 by5sm166764pad.36.2016.07.06.16.36.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Jul 2016 16:36:58 -0700 (PDT) From: Steve Longerbeam X-Google-Original-From: Steve Longerbeam To: linux-media@vger.kernel.org Cc: Steve Longerbeam Subject: [PATCH 3/6] ARM: dts: imx6-sabreauto: create i2cmux for i2c3 Date: Wed, 6 Jul 2016 16:36:40 -0700 Message-Id: <1467848203-14007-4-git-send-email-steve_longerbeam@mentor.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1467848203-14007-1-git-send-email-steve_longerbeam@mentor.com> References: <1467848203-14007-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