From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752938AbdC0MSN (ORCPT ); Mon, 27 Mar 2017 08:18:13 -0400 Received: from mail-eopbgr30137.outbound.protection.outlook.com ([40.107.3.137]:61246 "EHLO EUR03-AM5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752857AbdC0MRv (ORCPT ); Mon, 27 Mar 2017 08:17:51 -0400 Authentication-Results: linuxfoundation.org; dkim=none (message not signed) header.d=none;linuxfoundation.org; dmarc=none action=none header.from=axentia.se; 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 v11 07/12] dt-bindings: i2c: i2c-mux: document general purpose i2c-mux bindings Date: Mon, 27 Mar 2017 14:17:44 +0200 Message-ID: <1490617069-13119-8-git-send-email-peda@axentia.se> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1490617069-13119-1-git-send-email-peda@axentia.se> References: <1490617069-13119-1-git-send-email-peda@axentia.se> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [81.224.171.159] X-ClientProxiedBy: HE1PR0402CA0008.eurprd04.prod.outlook.com (10.175.27.18) To DB6PR0202MB2550.eurprd02.prod.outlook.com (10.169.211.8) X-MS-Office365-Filtering-Correlation-Id: 16c79146-9203-4fd1-4bf0-08d4750b1d9e X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DB6PR0202MB2550; X-Microsoft-Exchange-Diagnostics: 1;DB6PR0202MB2550;3:ofUPU2cB4lHqPGTC2H4UICJabLhsnU5jWVorfGrse2wPkNGBMe3Q1FEPw7z/YweSS+YNRBsh8b0V/tzxKOUR/meMpSWwkZCQc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VnBjGCdDArfM42Bm9l4EVDC+U1u9tASV4IwdVn5Q/8KXYtmcLMeSOPxK0q6qkLLsZVcsJijmEuC2uDcrAGx7j6GrClQlHmWK2Zy+ZLlZ/CqJpq7qhiU/q4ecNKm41aHokk1RVbk562zt9qLdAVTIw53qAekoN8ItyCWgv3e9Vqwr/QwJNgYLL9sG/VExUuMgT87TMw9WRgwgMo8BSk6+5Px2yHbp7R0C6sWa2LEOQ5UmPrzQzHX6p0PIJi1zCgq2YmZ2FPIZJJUJ1j4wJ0ZaZPulsVEdU4GUgJHKx9ohPUGs1WX1kCeHkErSvNNPkPUhfk9luCqZLzqSO4ipPTeVnxY/YBcbtazSSf4GyuMsCi7bCxSe5Bum9CSHvb1JgVxcDoRZq41XozlV9fahTJdQwAWkz5U0ooDFXN4L+WHCvNdCkJ6J/e69oC3fLlqCUBJXT5lebr8rAw9icoraTjb2excy/20jcIZy06K/XA/BHW+Ut/gcM6D86Xz00cjD4IDWeK/TzwKkr9kdvCUV2l6hFivvSaw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041248)(20161123555025)(20161123558025)(20161123564025)(2016111802025)(20161123562025)(20161123560025)(6072148)(6043046);SRVR:DB6PR0202MB2550;BCL:0;PCL:0;RULEID:;SRVR:DB6PR0202MB2550; X-Forefront-PRVS: 02596AB7DA X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6069001)(6009001)(39410400002)(39450400003)(39830400002)(36756003)(4326008)(50466002)(5003940100001)(33646002)(76176999)(53936002)(66066001)(6506006)(47776003)(6486002)(7736002)(8666007)(50986999)(54906002)(38730400002)(50226002)(86362001)(48376002)(6512007)(3846002)(6116002)(110136004)(8676002)(2906002)(189998001)(81166006)(42186005)(7416002)(6916009)(305945005)(6666003)(74482002)(2950100002)(25786009)(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:ZTb1RI2XdzvHYUJnzUqCk9ui/lRJ8dxJNWfE9DR?= =?us-ascii?Q?5tQBRaphFIuyLp98nnKsE1ioF04M5ECkts2vrFzzKbGkBCJEGbgLVyZFrUwn?= =?us-ascii?Q?vB8DOG7C5i8gWb+gftqEBFPSRD2bSmDOQxmKUMwCjs0HqYIQAPEEfHyvUMs9?= =?us-ascii?Q?1pQeVqUwFgEncCPQb9W5D+oaa0orBkIOKNLGvYOrcaEUu6aHHtabpy1mbAcw?= =?us-ascii?Q?wNs2xt3HTbsAN6giPIgE4hiRxtnSy4Hr+8QCOYH+axkUnIKkVFvbWKCbNvG9?= =?us-ascii?Q?y6mTrb3bf4lCvgzMPSJQbC+/FcYVn6p3dgjkP3Ai2bxSZhYjUafBXkO+vFnS?= =?us-ascii?Q?Tb8ME+3lhMXwhILqDVccLbPbHYgXqgE9GDTsjjvsO3RjFsJKHNdhgrWiPw7D?= =?us-ascii?Q?fBIPoXJaRFlVlToN5kX2qHltHnZAtfLCHofnLwMkqPw3QPiIFbxo2pf1doVb?= =?us-ascii?Q?i5quYYZ2JKy5CdLKaooUGnsdSntSl6Dhh+gyMThZo5khWK62D4d4wI13+uG6?= =?us-ascii?Q?MRuWLrckVRl60PRjCyPfMuwmKyRs8l69+JbaUI+7fD9r5U780qSui/w8YXoN?= =?us-ascii?Q?o68xj1P+i3uBFtbHY3HbTv4OxLOyjKOn+Fe9agmZQElIJjJHP/r6gxM7vtkY?= =?us-ascii?Q?6lgWZtvlM4nwxF/46B/c2Mkww1FtwRLkTNFvXVyeofABA4VqZFGMmsmPJ8SW?= =?us-ascii?Q?A2+v0Z0SDRsUb4ZlOA6BLR2mING4maPg8LNuqBB+x/V0RGJqKW9w8Lxc1CUu?= =?us-asc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5Obh8e3ZEAP9hIaKHJjMKY13AX791s3lqgJTbx46ty1lt+JazT3D9ymR2o/P7zAdXNv2Td5CVkehA= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DB6PR0202MB2550;7:myKLnKpLYc/GhaPgwrfmEaHIwSYVm+XWgUppqIcS2TXwqqQaNoq66K/zQmTpTRxgbU/R8VPkqaAkQEsIq7VBRKpWzgEcE7Q3Fvw2b6hQK26nIGEHTncyPSXubiYxszxZU1MAsyySmyEqZ5cSBCr2bvsgoVrF4KZAjn9oDR6VBUbpOLfRhTJc2me9Z/0k8cNLThhM9rwauqp5H7TdmtNnllKTLBoMJ/AxFqk91FhcSZqpo4CcC6oE3RaUCT4zvE5uQJAY+GSSFKiXqs9Rwr50NwKHDhesremRIt1I4Zx8rar+XCF6CO6T85Yo+WTkyEjt7xNA9m0QsEfWH0a4jp1b8A== X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Mar 2017 12:16:34.6217 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0202MB2550 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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>; + }; + }; + }; -- 2.1.4 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Rosin Subject: [PATCH v11 07/12] dt-bindings: i2c: i2c-mux: document general purpose i2c-mux bindings Date: Mon, 27 Mar 2017 14:17:44 +0200 Message-ID: <1490617069-13119-8-git-send-email-peda@axentia.se> References: <1490617069-13119-1-git-send-email-peda@axentia.se> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1490617069-13119-1-git-send-email-peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org> Sender: linux-iio-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org 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 , linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-doc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Andrew Morton , Colin Ian King , Paul Gortmaker List-Id: devicetree@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>; + }; + }; + }; -- 2.1.4