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: 7770881 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B5730BEEE1 for ; Fri, 4 Dec 2015 17:38:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C7A6C2049E for ; Fri, 4 Dec 2015 17:38:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C7A2D203EC for ; Fri, 4 Dec 2015 17:38:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754559AbbLDRb1 (ORCPT ); Fri, 4 Dec 2015 12:31:27 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:59935 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752772AbbLDRbZ (ORCPT ); Fri, 4 Dec 2015 12:31:25 -0500 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 Cc: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Russell King , Kukjin Kim , Krzysztof Kozlowski , Martyn Welch , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Olof Johansson 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> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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; + }; + }; +