From patchwork Fri Dec 4 17:31:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martyn Welch X-Patchwork-Id: 7770611 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 4CEB49F54F for ; Fri, 4 Dec 2015 17:34:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7ABFA20495 for ; Fri, 4 Dec 2015 17:34:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9DA3A2049C for ; Fri, 4 Dec 2015 17:34:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1a4uDC-0002If-KU; Fri, 04 Dec 2015 17:32:02 +0000 Received: from bhuna.collabora.co.uk ([46.235.227.227]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a4uCy-00028p-GC for linux-arm-kernel@lists.infradead.org; Fri, 04 Dec 2015 17:31:49 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: martyn) with ESMTPSA id 58B44260975 Received: from martyn by hermes with local (Exim 4.84) (envelope-from ) id 1a4uCX-0007Km-6t; Fri, 04 Dec 2015 17:31:21 +0000 From: Martyn Welch To: Arnd Bergmann , Greg Kroah-Hartman Subject: [PATCH 1/3] Device tree binding documentation for gpio-switch Date: Fri, 4 Dec 2015 17:31:13 +0000 Message-Id: <1449250275-23435-2-git-send-email-martyn.welch@collabora.co.uk> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1449250275-23435-1-git-send-email-martyn.welch@collabora.co.uk> References: <1449250275-23435-1-git-send-email-martyn.welch@collabora.co.uk> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151204_093148_714743_2CEB72E4 X-CRM114-Status: GOOD ( 14.82 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, Russell King , Martyn Welch , Pawel Moll , Ian Campbell , linux-kernel@vger.kernel.org, Rob Herring , Kukjin Kim , Kumar Gala , Olof Johansson , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds documentation for the gpio-switch binding. This binding provides a mechanism to bind named links to gpio, with the primary purpose of enabling standardised access to switches that might be standard across a group of devices but implemented differently on each device. Signed-off-by: Martyn Welch --- .../devicetree/bindings/misc/gpio-switch.txt | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 Documentation/devicetree/bindings/misc/gpio-switch.txt diff --git a/Documentation/devicetree/bindings/misc/gpio-switch.txt b/Documentation/devicetree/bindings/misc/gpio-switch.txt new file mode 100644 index 0000000..13528bd --- /dev/null +++ b/Documentation/devicetree/bindings/misc/gpio-switch.txt @@ -0,0 +1,47 @@ +Device-Tree bindings for gpio attached switches. + +This provides a mechanism to provide a named link to specified gpios. This can +be useful in instances such as when theres a need to monitor a switch, which is +common across a family of devices, but attached to different gpios and even +implemented in different ways on differnet devices. + +Required properties: + - compatible = "gpio-switch"; + +Each signal is represented as a sub-node of "gpio-switch". The naming of +sub-nodes is arbitrary. + +Required sub-node properties: + + - label: Name to be given to gpio switch. + - gpios: OF device-tree gpio specification. + +Optional sub-node properties: + + - read-only: Boolean flag to mark the gpio as read-only, i.e. the line + should not be driven by the host. + +Example nodes: + + gpio-switch { + compatible = "gpio-switch"; + + write-protect { + label = "write-protect"; + gpios = <&gpx3 0 GPIO_ACTIVE_LOW>; + read-only; + }; + + developer-switch { + label = "developer-switch"; + gpios = <&gpx1 3 GPIO_ACTIVE_HIGH>; + read-only; + }; + + recovery-switch { + label = "recovery-switch"; + gpios = <&gpx0 7 GPIO_ACTIVE_LOW>; + read-only; + }; + }; +