From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753747AbdBHQBN (ORCPT ); Wed, 8 Feb 2017 11:01:13 -0500 Received: from mail-db5eur01on0138.outbound.protection.outlook.com ([104.47.2.138]:63968 "EHLO EUR01-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750971AbdBHQBJ (ORCPT ); Wed, 8 Feb 2017 11:01:09 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; From: Peter Rosin To: CC: Peter Rosin , Wolfram Sang , "Rob Herring" , Mark Rutland , "Jonathan Cameron" , Hartmut Knaack , "Lars-Peter Clausen" , Peter Meerwald-Stadler , Jonathan Corbet , , , , , Andrew Morton Subject: [PATCH v9 07/10] dt-bindings: i2c: i2c-mux: document general purpose i2c-mux bindings Date: Wed, 8 Feb 2017 16:41:54 +0100 Message-ID: <1486568517-6997-8-git-send-email-peda@axentia.se> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1486568517-6997-1-git-send-email-peda@axentia.se> References: <1486568517-6997-1-git-send-email-peda@axentia.se> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [217.210.101.82] X-ClientProxiedBy: DB5PR08CA0069.eurprd08.prod.outlook.com (10.166.166.165) To HE1PR0202MB2555.eurprd02.prod.outlook.com (10.168.184.8) X-MS-Office365-Filtering-Correlation-Id: a6432fe5-69e5-4b48-fdb6-08d450393dd0 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:HE1PR0202MB2555; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0202MB2555;3:JaMg24xU5ss4RFEXq1JsZx0yiX1GCZ/zN6QACNFKcqS9gxMSvCfyWRlKCZZpAxMzp7UG5Qycb5mVkQ4pju3J6sWNhK6fOGEFnyYU1TBg+kQNLUC///a6vEM9WP5E+8XF0imXEHDDSwDTNhpZr7wg6CQUYKqlHnP5YBaeiQYk6CNUh9JhG55fe66RKeLWVDqwTPfETaGEDq+0lwAM/ASD92SIhOGMTZl5jC03pwO5Pnh+L9tSI1CoggSw+wCa79V9gCGtVKWwHWXunUy9t4TAGg==;25:VPLbPPkFIp6AzWEYJBDOo9scXWywM80Oa67ZoptwebezHTPaVDlpEw9r3mUqgERu9TUaytRpmtVeoJxJCFCgiHwdpbDjNuIEmbcUaaT4/6K9SvcXe/mCiSb5e3WnKJ6ym3nqhVO4KQRtxHaCVQI1pvXDlU7qVdDIlmzDM589jHoicL0t2JD6PIizuQqm0kyYMU26HjeF+ul3WxejWmZszQEgBpEwCetBbqiY8Ad9Pe8Lz08MpptZpXILySNL7uE3VVof4n+moOv0JF+j+e8MxA2yRbhWoFhmFRShSzyc5A9e1zC4tCqCpVBUJpwTFkCApD6ZmiLabOXDuSgfksqRp79l2lDKU0576s0QNApEAUKW6QWuqzHmga7l/D41TaLl1Y9MKX0u0QSEgs3rjlDFTQWq36uCruoiYqN3sf9f9WNg/PrqI6YuONc5/TYrNLgL X-Microsoft-Exchange-Diagnostics: 1;HE1PR0202MB2555;31:Rl+6fbDTI4DdXUPzmFcpqQbWOyHgwcV/Fuz4LGmFCMN3yV1P9og4Rn6xZR5INmkM4XoTFWcxl7+HGwa9jjuYxO2c1GBeo+UZQXCmQhSbdJulcmC4Vx+SPC63rj2kBS7Voke+SGZdjWKkVDFpKGGD8ulImiEjK09QR0lrN5xwF8Okpbm1DWlbMhJRuB17GL63fxuwUy3xGjqXbL/i6mqZ+kWTkKFeuv/+gTywb+j2A3UGxjPeARUv8mCJTYqon8Wl 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)(2017020702029)(8121501046)(20170203043)(3002001)(10201501046)(6041248)(2016111802025)(20161123564025)(20161123560025)(20161123558025)(20161123562025)(20161123555025)(6043046)(6072148);SRVR:HE1PR0202MB2555;BCL:0;PCL:0;RULEID:;SRVR:HE1PR0202MB2555; X-Microsoft-Exchange-Diagnostics: 1;HE1PR0202MB2555;4:mw4w24UZYWeGK1bYX/IuD5PLvUIh44Q2zld7JP2NVwH5vrwjzhPQSp88lnFALLbzXsBSeDOgMrbCCCEJnw6Srq9w0hgCzsYz/6pzeYutFUlTckXs2RyWlEr2WlfJvbQeDGfv44c2gSEZJPf/nZNa70UGNBVpYrGVDBYIdovmhdM9Vv+CVmNM7QALzhKWArIJzsa9LNtkOKrjq7LbDJMOYLxcREwrC2KD6vwBjd3ReEf4oWHPV6yDyAEeZVuAnoLUILf66WILXmUwkwJeQg3gR/kix30m6elYK8CVoFQkWHtHc1gXnmxTFArOimSq6936LfY5PpffNZlavU/GFkGSlSwxfP85jr7Jc7bZwsVTch+0Nkea1soxc6R/lNJVSIfmIWoxHHx1SYATsBRnoohw2SApd0yASX14f55oQN5RSJ7V6G7ZfCoUdp4gzMNWJnu5x1/xUkcl+AUHokVrS4YN+fi8/TEcECkoxT6EZZIk5XRU2ORfBQ4YFywUsjRnlRmQi7BvDXJlrTHC5rvs9SE/e+0/0wvOfSKgrA6LPvvmh1/hxWeTNTF0buzBLJPtyBTO5/z8/vmpohsDJjR6GwvWVK/ic0JTdQZkKyhOEjdbdc2NMoejT5iS7r2xNECOgkdrRe9DKetUysudarxZHgtT8U0iYvRPUjF1H1YZglQ0VcQ71PJuHbksD6NXf0mwVHorPT1eQtZ5C8CjNq+0qkaGNw== X-Forefront-PRVS: 0212BDE3BE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(6069001)(7916002)(39840400002)(39450400003)(39410400002)(199003)(189002)(6116002)(3846002)(7736002)(50466002)(2351001)(38730400002)(74482002)(2906002)(101416001)(305945005)(551934003)(97736004)(48376002)(8676002)(47776003)(110136004)(81166006)(76176999)(50986999)(81156014)(4326007)(6512007)(53936002)(6486002)(66066001)(86362001)(6506006)(33646002)(92566002)(7416002)(50226002)(6666003)(105586002)(42186005)(36756003)(5660300001)(189998001)(6916009)(25786008)(106356001)(2950100002)(5003940100001)(8666007)(54906002)(68736007)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:HE1PR0202MB2555;H:localhost.localdomain;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;HE1PR0202MB2555;23:dFzlZUIQTJwluvWKGsSn/+fP5tJJDpGqusB5kPG?= =?us-ascii?Q?naK0czQ1pOxGCE806GJzSsnHQ+HTzw7GABqUkoQR5lfhU6U/dAMCaJ1g6IrZ?= =?us-ascii?Q?FJRiXdEO+p0phSGDULmgDpnE79ERnX9gSCpxL5JaDxNHwJAb/JsRXYypodaQ?= =?us-ascii?Q?OJwzFqOfJ6JiS1bn2fJLxYHGpl7eJyQ8DXf80xWTOMLkoZv7hpqlIHJNW0xW?= =?us-ascii?Q?zDe1cAQKkRp3GiYRiS4LAeTRwY/UyglJ4NgPtgfXEDs7CwGWA1C3jTM+BNoQ?= =?us-ascii?Q?qhc5MRUI8W0mB9YBMYRGd4GJicNtryE2AbZ0erv3CdIrJJFl+EeXdpKoxcBD?= =?us-ascii?Q?Dmsj0r8dKCkXhg1COKp/qehaugWB4ZYJXXTjCfXUChXEiJuDL4ENSnL5gm1x?= =?us-ascii?Q?+VYQYxt/Ru8xl66uxIBEwJUkZOmPdCg2pcsW2RhUXq2wYx0fJXprfQyj08Ou?= =?us-ascii?Q?fRyHf/97aUaDTjRc0ZNLM2Y0xIXi5q7OF2S0vRNHC6smmM4wtZ6kcDlhdWp8?= =?us-ascii?Q?y6DBy2jGdPYXa71QuTACMrkCWJzaqlnum54CuswwnIUJQwvqDSJR8GH9FctR?= =?us-ascii?Q?BgfWbK/xDrKf08GIszsRDGuw6LN+RwkYSvozUDwU+ac6fGpMauInO7xNOWeQ?= =?us-ascii?Q?K06U5Vm8AVfI3zAmdb5HQrLbrT20JkRMAmo9L5uMrt4yowSW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7or6mDLIZZostRq2N0F+UBiwf2zD+A3xKXPP+/fWcaKc66qiwZzFOl5t7ETA4JLnrFaDGjOQg9gZg9NW0OY67dhb051fWk5yz/I1C7E4QgUI12kAHJAatlZjZVIgqB/K8h2y4f4Gw3QbqGtKU0rhYb1U/4Ki25sFg==;5:N+3FMDdRpnMlyJ7As+ujMaOxmV8NM378mfYDMZaGwZvGwRgg6DY5iZLniGJnaxGWcRAIL/N1wOC5L0oB5WtIPhs1t5zduznkppTk8Ggv9agv45XfknBUrCXDDOJTb+5818QJKUfqDZkKPr4nrG6xPg==;24:gn+MawEOpV70EgCTMxEf/n908D1CHy7OTu+8z21CxS4uUcvvP6D5dVFDtLt6q0+XZFkxmMZcdXnqyvaful3WUx0mosueCcGVGmpsD16pHu8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;HE1PR0202MB2555;7:zGGCii/plfEBVOqz9N3E6GnUAXFPW4Z4JqOBG2yGd3qpurkBSTFT2CJVJueJvFVvcLHQizKFknu7BUZPWIVeveYrM64WqL/BF87JnUcPSG2sy1Fq8RjRZez83Oe4Pd+9tdmVwctyWJlKZOfT2OoIpo8ONCPaII66Ury1I/p+oDjlZRBO5apNTmjkoP6FKbcN19dA9YiGEfLJO4y34zqZY/etflJDnBTWrPzYL+QcnW0dx/rcwsn3Kq9cffb0gqwCIHPK5ViNj3Im3xIlsnn5CvSTB6+u3HhGZXg3N6iDcReGdZsrG3Sm1aK4ocY0RUyOGa4pTu6qO6DuXXourt54a4/ExGoYw4qtRi9DqQqjdJ9nHcHtjHuR6RdRoao+U8cgjec4/EERGDccJcRjGMBg7x6Jmj9JNnuoTEz/SnHTPnc8wjAMhCosX0fcUEbBsmNzFVh9L8CzREWHkeH9npMmGhDyP0pYXVTh4/dcVyTJ4Mzs7r37oNOhfXZdSBP47nk6RHhRWqsBEvNlp+B7drULRQ== X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2017 15:43:32.4448 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0202MB2555 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 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 v9 07/10] dt-bindings: i2c: i2c-mux: document general purpose i2c-mux bindings Date: Wed, 8 Feb 2017 16:41:54 +0100 Message-ID: <1486568517-6997-8-git-send-email-peda@axentia.se> References: <1486568517-6997-1-git-send-email-peda@axentia.se> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1486568517-6997-1-git-send-email-peda@axentia.se> Sender: linux-i2c-owner@vger.kernel.org To: linux-kernel@vger.kernel.org Cc: Peter Rosin , Wolfram Sang , Rob Herring , Mark Rutland , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Jonathan Corbet , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-iio@vger.kernel.org, linux-doc@vger.kernel.org, Andrew Morton List-Id: devicetree@vger.kernel.org Describe how a general purpose multiplexer controller is used to mux an i2c bus. Acked-by: Jonathan Cameron 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