From patchwork Sun Sep 17 11:14:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9954755 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D45AC60568 for ; Sun, 17 Sep 2017 11:15:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDD2028B56 for ; Sun, 17 Sep 2017 11:15:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2E8228B9E; Sun, 17 Sep 2017 11:15:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4850B28B56 for ; Sun, 17 Sep 2017 11:15:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750862AbdIQLPG (ORCPT ); Sun, 17 Sep 2017 07:15:06 -0400 Received: from mail-lf0-f43.google.com ([209.85.215.43]:46290 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750793AbdIQLPF (ORCPT ); Sun, 17 Sep 2017 07:15:05 -0400 Received: by mail-lf0-f43.google.com with SMTP id m199so5674083lfe.3 for ; Sun, 17 Sep 2017 04:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KILbrrreLSuWUs8BJsk5IiaG68+EzsH09yOdZGDXDYA=; b=KI5esYYidEzMmlwwZiKFFVrOG9UaUQzuI8BMNxRQoyT/Mef0MpoNAtIVfMzgByhPd4 Msc8MIi8jCKJqy4OKPQAfhDWwLB4LoZ7vl+kHl+n61AmSOSZEdPxmVnuVWCs3ysrYqCJ QOoheyM050vQDwpdeVipM+RInIJAJMQVz8UrA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KILbrrreLSuWUs8BJsk5IiaG68+EzsH09yOdZGDXDYA=; b=pe6Wm1kcr8asayT9cGyWhEJhSfvbcD9kAgOQph0x4yt46bdbjIcIs0DxA4cVP02DpB Mb4ZUpmRiiEbb9DGed03F6Vsv7SdDBA+B1m8QzK0xEdcrqGgYZ8j9S1ih7EuGmA9bQfo kBiuT4ftN9DrnFL0vcSdIr2+We1QYM7wOMhebQEAwojl5NBCze/JHsuAfhYOVjkrSHr2 B7Dm6iKSUnhb87RNhz7wcxGa5TZ/dD5TLzT3cLyIQpXoX+2PQr0vc1zLAP0ydSxgAACM m2JlRVbSfONgI/wrBmJNtEy1NnpBNlkEYuUzYCtkYk7XOPiD5DyCcKf/HyrN4Z+lwAVW fdvA== X-Gm-Message-State: AHPjjUgA8V2b/o4xpB1kS5KkdzMBqxJmJxNQxRnm3T3nC/ZBgcgsYUAa 46YctfMB5iznPt2L X-Google-Smtp-Source: AOwi7QC2dAP0Am8C6Zy2C5GJnlbVkuSKQx96pit8vttbTjUrz4nHdO2owQ7xHv4mB1qGP86fqrae8Q== X-Received: by 10.46.33.202 with SMTP id h71mr11695205lji.56.1505646903680; Sun, 17 Sep 2017 04:15:03 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-2209e055.014-348-6c756e10.cust.bredbandsbolaget.se. [85.224.9.34]) by smtp.gmail.com with ESMTPSA id h83sm1007069lfi.16.2017.09.17.04.15.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 17 Sep 2017 04:15:02 -0700 (PDT) From: Linus Walleij To: Dmitry Torokhov , linux-input@vger.kernel.org, Hans-Christian Noren Egtvedt Cc: Linus Walleij , devicetree@vger.kernel.org Subject: [PATCH 3/5] input: mouse: Add DT bindings for GPIO mice Date: Sun, 17 Sep 2017 13:14:43 +0200 Message-Id: <20170917111445.30880-4-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170917111445.30880-1-linus.walleij@linaro.org> References: <20170917111445.30880-1-linus.walleij@linaro.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds DT bindings for simple mice attached to GPIO lines. As the properties are very general and pertains to all mice I can think of, we use very generic names for the 4-7 GPIO lines, "up", "down" etc. Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij --- This patch is inspired by the existance of a GPIO mouse driver with no in-kernel users. --- .../devicetree/bindings/input/gpio-mouse.txt | 32 ++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/gpio-mouse.txt diff --git a/Documentation/devicetree/bindings/input/gpio-mouse.txt b/Documentation/devicetree/bindings/input/gpio-mouse.txt new file mode 100644 index 000000000000..82622a439745 --- /dev/null +++ b/Documentation/devicetree/bindings/input/gpio-mouse.txt @@ -0,0 +1,32 @@ +Device-Tree bindings for GPIO attached mice + +This simply uses standard GPIO handles to define a simple mouse connected +to 4-7 GPIO lines. + +Required properties: + - compatible: must be "gpio-mouse" + - scan-interval: The scanning interval in milliseconds + - up-gpios: GPIO line phandle to the line indicating "up" + - down-gpios: GPIO line phandle to the line indicating "down" + - left-gpios: GPIO line phandle to the line indicating "left" + - right-gpios: GPIO line phandle to the line indicating "right" + +Optional properties: + - button-left-gpios: GPIO line handle to the left mouse button + - button-middle-gpios: GPIO line handle to the middle mouse button + - button-right-gpios: GPIO line handle to the right mouse button +Example: + +#include + +gpio-mouse { + compatible = "gpio-keys"; + scan-interval = <50>; + up-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>; + down-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>; + left-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>; + right-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>; + button-left-gpios = <&gpio0 4 GPIO_ACTIVE_LOW>; + button-middle-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>; + button-right-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>; +};