From patchwork Mon Mar 27 14:22:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 743840 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3vsGSL342pz9s7C for ; Tue, 28 Mar 2017 01:22:10 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=axentiatech.onmicrosoft.com header.i=@axentiatech.onmicrosoft.com header.b="MX9XecFA"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753499AbdC0OV7 (ORCPT ); Mon, 27 Mar 2017 10:21:59 -0400 Received: from mail-ve1eur01on0102.outbound.protection.outlook.com ([104.47.1.102]:15260 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753420AbdC0OV2 (ORCPT ); Mon, 27 Mar 2017 10:21:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axentiatech.onmicrosoft.com; s=selector1-axentia-se; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=4paOfEu9FeHKWAGFTLKNdXx7o8Z1tSxxlsrPYDzNN94=; b=MX9XecFAH7ZVv0QCaLbu6sL+Se0DJajQLiYOQx6vL5ytLGTOrBrzNpKAauIfajxrJTj8dezRm2R94Olvblib/DHJJCh6phfQNfoSroxvJiHpQmBK2wGVF+Ijkw+BmxfN3hv8J4Zzk0ZSWbSfm6FsDfx7GQ/VgkH+fnnd32DGves= Authentication-Results: linuxfoundation.org; dkim=none (message not signed) header.d=none; linuxfoundation.org; dmarc=none action=none header.from=axentia.se; Received: from localhost.localdomain (81.224.171.159) by DB6PR0202MB2550.eurprd02.prod.outlook.com (10.169.211.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.961.17; Mon, 27 Mar 2017 14:20:42 +0000 From: Peter Rosin To: Greg Kroah-Hartman CC: Peter Rosin , Wolfram Sang , Rob Herring , Mark Rutland , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Jonathan Corbet , , , , , , Andrew Morton , Colin Ian King , Paul Gortmaker Subject: [PATCH v12 07/10] dt-bindings: i2c: i2c-mux: document general purpose i2c-mux bindings Date: Mon, 27 Mar 2017 16:22:02 +0200 Message-ID: <1490624525-15865-8-git-send-email-peda@axentia.se> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1490624525-15865-1-git-send-email-peda@axentia.se> References: <1490624525-15865-1-git-send-email-peda@axentia.se> MIME-Version: 1.0 X-Originating-IP: [81.224.171.159] X-ClientProxiedBy: DB6PR0202CA0048.eurprd02.prod.outlook.com (10.171.70.34) To DB6PR0202MB2550.eurprd02.prod.outlook.com (10.169.211.8) X-MS-Office365-Filtering-Correlation-Id: df675586-813b-44fc-e199-08d4751c749e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:DB6PR0202MB2550; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0202MB2550; 3:gVSzDG+IDmNohVd3sBF56/7uHCLlZm08FR7eVHhPMS5cnReIT+eEPbExf2a7jOfmdVHPPYGSTHCTNZIdr7CKAeW4n5ldSp8jV8XehJqWQst/XwEWEUg8MaIDREb8W55UkemHXRVBSv8gn0x1coKQrEinPJBhcSBEBnfOZ7jkZeHZWzVB7mQcxdutHSk2d7WwG6ALgsGDw3vUzfmPB1tUcoQ0/epqZ6oxAOA/Cb8dAMKlpaGT1fIOMzt9I2zlbCNZ9Mp9cCu7xqIY8tkt+O8ujQ==; 25:nN/ImbLXusftduz/H6dPP6YMtP2dmglsh/KhqllTSU3dU7VxYNL+kziWwKX6sLTet1VjC8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Z6IV2qF/0xbuOy4zn24IDew/oVF4bS8H1MsCIujPQDY3bP72QxGKL43oPdS68knMzV9Qh2+rRuU9mXQhAjHJg0Fj54v7DaHvCA6i9z4uNvE8yIjlc943c4LKXI1CVI78INS8A6kALK/SeywLajQs8xHD0SrkSuHP/8cs9o633uM8+C/M1g7uPt4UMsjRRWhvm2R6NZZ6wMaC3CNx4XHHdidiIuEhm6KUJNnLBfpLqmLi1qCntq7VYj+4IcQxVG5kPrpEdF/PGhjYg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(20161123564025)(20161123558025)(20161123555025)(20161123560025)(20161123562025)(2016111802025)(6072148)(6043046); SRVR:DB6PR0202MB2550; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0202MB2550; X-Forefront-PRVS: 02596AB7DA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(39840400002)(39410400002)(39450400003)(4326008)(36756003)(5003940100001)(33646002)(50466002)(53936002)(76176999)(66066001)(47776003)(6506006)(6486002)(7736002)(8666007)(50986999)(54906002)(38730400002)(50226002)(86362001)(6512007)(48376002)(3846002)(6116002)(8676002)(110136004)(2906002)(81166006)(42186005)(7416002)(189998001)(6916009)(305945005)(6666003)(25786009)(2950100002)(74482002)(551934003)(5660300001)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:DB6PR0202MB2550; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0202MB2550; 23:SKd5etCptGcAD7TEe6FpuzTPbLvvA/uOZG3K/6b?= =?us-ascii?Q?5h2BjOPUHq64IvuLfntMrklzHsxlnSN2VRIGHaEzpCOmfv+MhFD0/w98XHve?= =?us-ascii?Q?+ylyHMn8L/skaENrOThF0G5o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/xm6Y+o6EBxQXBDjwGjSrQC5PFCe9bZh95Moulkrx6Kc6xaa4hletV9Jy6LLpvPyPwW3Wdpm3esmhfWFXbtQn+2AcQkbQ5fRPj0LdbGj+d7NJ544RIeqxYfF3Bm5G8MfskQsaK5RhwxJujy96HyFKwIiWJtk00umJbHwGS3Llww2DKeR/XKkEGDTYbhhDb9vKbjHToKvW9Jk+wYtHlpzBaoAT3A== X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Mar 2017 14:20:42.5131 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0202MB2550 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Describe how a general purpose multiplexer controller is used to mux an i2c bus. Acked-by: Jonathan Cameron Reviewed-by: Rob Herring Signed-off-by: Peter Rosin --- .../devicetree/bindings/i2c/i2c-mux-gpmux.txt | 99 ++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt diff --git a/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt new file mode 100644 index 000000000000..2907dab56298 --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/i2c-mux-gpmux.txt @@ -0,0 +1,99 @@ +General Purpose I2C Bus Mux + +This binding describes an I2C bus multiplexer that uses a mux controller +from the mux subsystem to route the I2C signals. + + .-----. .-----. + | dev | | dev | + .------------. '-----' '-----' + | SoC | | | + | | .--------+--------' + | .------. | .------+ child bus A, on MUX value set to 0 + | | I2C |-|--| Mux | + | '------' | '--+---+ child bus B, on MUX value set to 1 + | .------. | | '----------+--------+--------. + | | MUX- | | | | | | + | | Ctrl |-|-----+ .-----. .-----. .-----. + | '------' | | dev | | dev | | dev | + '------------' '-----' '-----' '-----' + +Required properties: +- compatible: i2c-mux +- i2c-parent: The phandle of the I2C bus that this multiplexer's master-side + port is connected to. +- mux-controls: The phandle of the mux controller to use for operating the + mux. +* Standard I2C mux properties. See i2c-mux.txt in this directory. +* I2C child bus nodes. See i2c-mux.txt in this directory. The sub-bus number + is also the mux-controller state described in ../mux/mux-controller.txt + +Optional properties: +- mux-locked: If present, explicitly allow unrelated I2C transactions on the + parent I2C adapter at these times: + + during setup of the multiplexer + + between setup of the multiplexer and the child bus I2C transaction + + between the child bus I2C transaction and releasing of the multiplexer + + during releasing of the multiplexer + However, I2C transactions to devices behind all I2C multiplexers connected + to the same parent adapter that this multiplexer is connected to are blocked + for the full duration of the complete multiplexed I2C transaction (i.e. + including the times covered by the above list). + If mux-locked is not present, the multiplexer is assumed to be parent-locked. + This means that no unrelated I2C transactions are allowed on the parent I2C + adapter for the complete multiplexed I2C transaction. + The properties of mux-locked and parent-locked multiplexers are discussed + in more detail in Documentation/i2c/i2c-topology. + +For each i2c child node, an I2C child bus will be created. They will +be numbered based on their order in the device tree. + +Whenever an access is made to a device on a child bus, the value set +in the relevant node's reg property will be set as the state in the +mux controller. + +Example: + mux: mux-controller { + compatible = "gpio-mux"; + #mux-control-cells = <0>; + + mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>, + <&pioA 1 GPIO_ACTIVE_HIGH>; + }; + + i2c-mux { + compatible = "i2c-mux"; + mux-locked; + i2c-parent = <&i2c1>; + + mux-controls = <&mux>; + + #address-cells = <1>; + #size-cells = <0>; + + i2c@1 { + reg = <1>; + #address-cells = <1>; + #size-cells = <0>; + + ssd1307: oled@3c { + compatible = "solomon,ssd1307fb-i2c"; + reg = <0x3c>; + pwms = <&pwm 4 3000>; + reset-gpios = <&gpio2 7 1>; + reset-active-low; + }; + }; + + i2c@3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + + pca9555: pca9555@20 { + compatible = "nxp,pca9555"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x20>; + }; + }; + };