From patchwork Wed Jan 18 15:57:05 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 716722 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3v3XHw4FCwz9t0C for ; Thu, 19 Jan 2017 03:20:12 +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="Inbth75/"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752731AbdARQUL (ORCPT ); Wed, 18 Jan 2017 11:20:11 -0500 Received: from mail-ve1eur01on0130.outbound.protection.outlook.com ([104.47.1.130]:63661 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752213AbdARQUI (ORCPT ); Wed, 18 Jan 2017 11:20:08 -0500 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=YoICYr71vJ1BnFLAsYA8YUA0onPFF2SjjsOUYqwF4BI=; b=Inbth75/c2crBU/Skg7ORDtKoFz3L4hHNhL3JT50z8m9Qh3izSIO9DrJfEi5ay8/U51NmBS5J38DVFf8THaEZeNfRp44Mt6lrNWrSgjIEPtIEG03p+USCHAoiREBw9MMlPL1DFyWdvc2dM02CR7KmOYVTpVgZXulKaxAX//XRmA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; Received: from localhost.localdomain (217.210.101.82) by VI1PR0202MB2558.eurprd02.prod.outlook.com (10.173.79.137) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Wed, 18 Jan 2017 15:58:23 +0000 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 v8 02/12] dt-bindings: document devicetree bindings for mux-controllers and mux-gpio Date: Wed, 18 Jan 2017 16:57:05 +0100 Message-ID: <1484755035-25927-3-git-send-email-peda@axentia.se> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1484755035-25927-1-git-send-email-peda@axentia.se> References: <1484755035-25927-1-git-send-email-peda@axentia.se> MIME-Version: 1.0 X-Originating-IP: [217.210.101.82] X-ClientProxiedBy: HE1PR0801CA0032.eurprd08.prod.outlook.com (10.167.184.42) To VI1PR0202MB2558.eurprd02.prod.outlook.com (10.173.79.137) X-MS-Office365-Filtering-Correlation-Id: a02d5fa9-e0f4-416f-088f-08d43fbad60c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:VI1PR0202MB2558; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0202MB2558; 3:xyNkgO5Cll0iilvDChf3rAqH8gqoVfUrN1BcZs2NZMMIdn+W0lHtmt1qw3RD/sE5y2FIWw1iwB1pTyR29ZPulfYaltES5fbqc0LtfM7kkQu0vEBFCSxQua8hDcA62xL2QV461PeJo2/lQiEU/L2EUAPHx7uKl0Esvy08QTJZyCyUbTE96SHnGYpSa/o0bIPIek5Xckr1IffGiOB7sRUakS4xn4lPHrpGIC1Pj016gzyhtdvBr3Hf1OKoPvGbUEybbX132N2O/+C81UatqiFwdA==; 25:BS7eidI8DBN8oOmEw9Yq6E4FvgHt0hp9wyG33ikf6ZvtpBDA8TE4KdQzU6k9ls2JM55JdMiccVk69K9Y7FEj39q/0TKg1F3qOD3n/puCAw+ROwEw7c43bWMaSQIfaYsx+duyPNl82ncOWgBXvYcFFpEUH2G9O+EayFwWNBxNNRZk2UIm3HXgcoVdqvmAWWFd09IkKQMWisaz/ZC7sr+VUGbzIPbDRffCdAJyi5DJ04lPRdAXYHH3yLTeMCJi/DdkJJBucN1l35qXQosnD8b8K+Fgvjt6rcjyfSqROC6DGiFs6COzKzwJW0KOse+GB75RNjYdxhLAZ1HBjHpjs6PLpqf9bsmyvkXo7ykdQFy6GWvhxUP0ioqBidkpJ5RTF4PbJfJzbTBc7kVCcrdVvM+KBpEV63FXGc6dZJc4BqWTILnQBbRsw4vT4YSNULuGDpG7 X-Microsoft-Exchange-Diagnostics: 1; VI1PR0202MB2558; 31:8wAWIb+rfDB/r2NsYTRZTYTuK8OZgVKTf/ihdNPtOVAzFGxGYqgJ8l3jRqjgOlgUbfBeAN+5tuPUEOd+IS+bx54fP8QkKWXugf5G00GQ+xIEj3YNpQ9bsGQQtjT9dHh89TYOt4BGGUAJ92Il/Srcc1SfuO98HxS5XAZv+0VyrLhqJdFUbDx1rTQKe6WATYluwOSgfPIAfQ4/p7BfPDURi0fx4EzOkoNtbrRoZg8kRqaw5hwMwa8DG7pmOq2xXHR4NQkcgNET+ck4zbEWcTnCtw== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(11668515415152); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(10201501046)(3002001)(6041248)(2016111802025)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(6072148)(6043046); SRVR:VI1PR0202MB2558; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0202MB2558; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0202MB2558; 4:a1lh6O4VxcPOS0zNbL9qcfOWqW3qLpXTMIVIJ/1AtvFzh+2sGyYt/4Y1Fu9NROJz38+acf9cA2TITT0YIlva/1QSRs4CcJjY5Tud6zbYoT6NxequYw8E+4UyuKaPwA9Rlz39A+IzbVU1lRrsOdGjAoIFcYVYhb5xGGSJcltphzir+EftvnIiyUUCo5c7/wSzll3OYskhHISLgl3uQ2MrMLSNHlNVUFi4cPgAe8SCESVpXiO//FFk9p0+wKTThnucnSn1SzTldnajWe0JyAINtHPwgG5dfEzd88GOP795qUOnzoyItttedUkRis0YucdGoRu3SefQ0nJNkL7gLWX4I3GcsFA1m/IfzbCoQpXUDERXz8lUQrNfS86LsAgG74/EQwK3HJqgIOargXns5Mh8EyhyuG8sGqfla3g9DTC5HpobtY7zwvDvWjB/26Zzx0JOKFs/ntN8f5xG4Fl0MSQQI375QiA4saKHTJvu5ANq6Gg8bL3h100izdJQs4uakKxz0JTbqodN43eyxPaYbP971MdGCHre7rASlVYyxyZoYQ20SdApI1nIblKCulkEa4ougRmxtoHVIt0oUFNOb1m6yHH2DKVQb6Ur3peTk+ZlEPSuOsMkKufj8sDPGks9riw1digFvtuAIoWNrkGBx1irtikyPewyJfmRqfaK2IidWvc= X-Forefront-PRVS: 01917B1794 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(7916002)(39830400002)(39450400003)(39410400002)(189002)(199003)(3846002)(38730400001)(6512007)(5660300001)(50466002)(101416001)(47776003)(48376002)(54906002)(97736004)(76176999)(53936002)(189998001)(50986999)(305945005)(7416002)(4326007)(74482002)(106356001)(2950100002)(6666003)(86362001)(6116002)(81166006)(6916009)(68736007)(5003940100001)(36756003)(7736002)(2906002)(575784001)(25786008)(8666007)(42186005)(2351001)(81156014)(33646002)(6486002)(110136003)(6506006)(66066001)(92566002)(105586002)(50226002)(8676002)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0202MB2558; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: axentia.se does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0202MB2558; 23:3IaH7cqVRqsCUQ0cszWPjBPEEAQTMnSz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tJRHfv1EH1n4TDxfwbIwkRzoZtuKUhKYe0379OGThH54KYt+Zy/aAx9mqZznOIGf2E1K/SUEyK+4y8V7rHNQQSlBFHEpKzlAQIB8Q86WgcdBohsjpq9Q==; 24:wmSjTw5T9f5+QE1bg2+2AaK1MjgLkeS524Eut6Ml7T1pyeGPJp5KV5NkZUOCA5O0BgVpccUkCOS5HrGMiKns7sj+4Lox34H9Ltvfz88kIaI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0202MB2558; 7:V7R2I6QbIJ+ahkhVq9hzWpWDrYFY9uo5ND6L5XrduNPiQWiS0bgKz2i98OtpIBzzPEg6mfgwwcXD4QsfzvP+XVn3pBumpr3cqhme89FS69tX6cPmlnjYJAA9lG2n/SqXxyefs8itPBjlWVwIutK1TNt7r7+NJkxOivrKHYFiW/jssIxwt3m1njI80Y4sjoyhIjRZctxbHTji7rebfb8cuWTVKYNvuP2WFT3Lto7WQaP1F26dTDiWKd4bIFeflcPcCxsEV5Zk2rhYv/26xGoV0ciunatl2T8TlSNgZ1MSUz6XPghprEe+RH1XU83Mw3MS4ObNrUtpgcQ0V9NGEubSt05nR3bRDDSlp83k0sQdaxuSfUIS0rUKJdTCwG7MINkNFFzRFUANCiNzUtz5t2Z19qt7l+NU5te1A1Z8gSWWm1ULAwGU3dursYjc6D0AfzDdSiTzACQkfwE1YhEHj3Cyrg== X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2017 15:58:23.5316 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0202MB2558 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Allow specifying that a single multiplexer controller can be used to control several parallel multiplexers, thus enabling sharing of the multiplexer controller by different consumers. Add a binding for a first mux controller in the form of a GPIO based mux controlled. Acked-by: Jonathan Cameron Signed-off-by: Peter Rosin Acked-by: Rob Herring --- .../devicetree/bindings/mux/mux-controller.txt | 127 +++++++++++++++++++++ Documentation/devicetree/bindings/mux/mux-gpio.txt | 68 +++++++++++ MAINTAINERS | 5 + 3 files changed, 200 insertions(+) create mode 100644 Documentation/devicetree/bindings/mux/mux-controller.txt create mode 100644 Documentation/devicetree/bindings/mux/mux-gpio.txt diff --git a/Documentation/devicetree/bindings/mux/mux-controller.txt b/Documentation/devicetree/bindings/mux/mux-controller.txt new file mode 100644 index 000000000000..42b2177e5ae1 --- /dev/null +++ b/Documentation/devicetree/bindings/mux/mux-controller.txt @@ -0,0 +1,127 @@ +Common multiplexer controller bindings +====================================== + +A multiplexer (or mux) controller will have one, or several, consumer devices +that uses the mux controller. Thus, a mux controller can possibly control +several parallel multiplexers. Presumably there will be at least one +multiplexer needed by each consumer, but a single mux controller can of course +control several multiplexers for a single consumer. + +A mux controller provides a number of states to its consumers, and the state +space is a simple zero-based enumeration. I.e. 0-1 for a 2-way multiplexer, +0-7 for an 8-way multiplexer, etc. + + +Consumers +--------- + +Mux controller consumers should specify a list of mux controllers that they +want to use with a property containing a 'mux-ctrl-list': + + mux-ctrl-list ::= [mux-ctrl-list] + single-mux-ctrl ::= [mux-ctrl-specifier] + mux-ctrl-phandle : phandle to mux controller node + mux-ctrl-specifier : array of #mux-control-cells specifying the + given mux controller (controller specific) + +Mux controller properties should be named "mux-controls". The exact meaning of +each mux controller property must be documented in the device tree binding for +each consumer. An optional property "mux-control-names" may contain a list of +strings to label each of the mux controllers listed in the "mux-controls" +property. + +Drivers for devices that use more than a single mux controller can use the +"mux-control-names" property to map the name of the requested mux controller +to an index into the list given by the "mux-controls" property. + +mux-ctrl-specifier typically encodes the chip-relative mux controller number. +If the mux controller chip only provides a single mux controller, the +mux-ctrl-specifier can typically be left out. + +Example: + + /* One consumer of a 2-way mux controller (one GPIO-line) */ + mux: mux-controller { + compatible = "mux-gpio"; + #mux-control-cells = <0>; + + mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>; + }; + + adc-mux { + compatible = "io-channel-mux"; + io-channels = <&adc 0>; + io-channel-names = "parent"; + mux-controls = <&mux>; + mux-control-names = "adc"; + + channels = "sync", "in"; + }; + +Note that in the example above, specifying the "mux-control-names" is redundant +because there is only one mux controller in the list. + + /* + * Two consumers (one for an ADC line and one for an i2c bus) of + * parallel 4-way multiplexers controlled by the same two GPIO-lines. + */ + mux: mux-controller { + compatible = "mux-gpio"; + #mux-control-cells = <0>; + + mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>, + <&pioA 1 GPIO_ACTIVE_HIGH>; + }; + + adc-mux { + compatible = "io-channel-mux"; + io-channels = <&adc 0>; + io-channel-names = "parent"; + mux-controls = <&mux>; + + channels = "sync-1", "in", "out", "sync-2"; + }; + + i2c-mux { + compatible = "i2c-mux-simple,mux-locked"; + i2c-parent = <&i2c1>; + mux-controls = <&mux>; + + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + ssd1307: oled@3c { + /* ... */ + }; + }; + + i2c@3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + + pca9555: pca9555@20 { + /* ... */ + }; + }; + }; + + +Mux controller nodes +-------------------- + +Mux controller nodes must specify the number of cells used for the +specifier using the '#mux-control-cells' property. + +An example mux controller might look like this: + + mux: adg792a@50 { + compatible = "adi,adg792a"; + reg = <0x50>; + #mux-control-cells = <1>; + }; diff --git a/Documentation/devicetree/bindings/mux/mux-gpio.txt b/Documentation/devicetree/bindings/mux/mux-gpio.txt new file mode 100644 index 000000000000..8f6bda6f9d78 --- /dev/null +++ b/Documentation/devicetree/bindings/mux/mux-gpio.txt @@ -0,0 +1,68 @@ +GPIO-based multiplexer controller bindings + +Define what GPIO pins are used to control a multiplexer. Or several +multiplexers, if the same pins control more than one multiplexer. + +Required properties: +- compatible : "mux-gpio" +- mux-gpios : list of gpios used to control the multiplexer, least + significant bit first. +- #mux-control-cells : <0> +* Standard mux-controller bindings as decribed in mux-controller.txt + +Optional properties: +- idle-state : if present, the state the mux will have when idle. + +The multiplexer state is defined as the number represented by the +multiplexer GPIO pins, where the first pin is the least significant +bit. An active pin is a binary 1, an inactive pin is a binary 0. + +Example: + + mux: mux-controller { + compatible = "mux-gpio"; + #mux-control-cells = <0>; + + mux-gpios = <&pioA 0 GPIO_ACTIVE_HIGH>, + <&pioA 1 GPIO_ACTIVE_HIGH>; + }; + + adc-mux { + compatible = "io-channel-mux"; + io-channels = <&adc 0>; + io-channel-names = "parent"; + + mux-controls = <&mux>; + + channels = "sync-1", "in", "out", "sync-2"; + }; + + i2c-mux { + compatible = "i2c-mux-simple,mux-locked"; + i2c-parent = <&i2c1>; + + mux-controls = <&mux>; + + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + + ssd1307: oled@3c { + /* ... */ + }; + }; + + i2c@3 { + reg = <3>; + #address-cells = <1>; + #size-cells = <0>; + + pca9555: pca9555@20 { + /* ... */ + }; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 40de344ba0e6..be57f5b8f2c2 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -8469,6 +8469,11 @@ S: Orphan F: drivers/mmc/host/mmc_spi.c F: include/linux/spi/mmc_spi.h +MULTIPLEXER SUBSYSTEM +M: Peter Rosin +S: Maintained +F: Documentation/devicetree/bindings/mux/ + MULTISOUND SOUND DRIVER M: Andrew Veliath S: Maintained