From patchwork Mon Sep 25 16:34:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9970207 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 5E28360225 for ; Mon, 25 Sep 2017 16:34:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 504332823E for ; Mon, 25 Sep 2017 16:34:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4512C28766; Mon, 25 Sep 2017 16:34:49 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,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 E1B472823E for ; Mon, 25 Sep 2017 16:34:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965219AbdIYQeq (ORCPT ); Mon, 25 Sep 2017 12:34:46 -0400 Received: from mail-pg0-f46.google.com ([74.125.83.46]:45380 "EHLO mail-pg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965218AbdIYQep (ORCPT ); Mon, 25 Sep 2017 12:34:45 -0400 Received: by mail-pg0-f46.google.com with SMTP id 188so4271745pgb.2 for ; Mon, 25 Sep 2017 09:34:44 -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=pYiyERwh1LQwPSpVBOBgHbzIS0tfpE12XQqMzbW7BWM=; b=E1MRng9bhqLrmOwX5zpKuNoPvg38UEXjlQMqDv676ks7XHCLZgDj8QAlI9Vse8JJmu 6msEvrXUo5kBkAaNrQm1ar9QjrqeRJxpgtvLwHuLJwNl3Y13+MPwjpXN3C8To5sLyhvU wNMlQNqErKjZk/cOu/1/ZCeh6lipLo+aoXlEU= 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=pYiyERwh1LQwPSpVBOBgHbzIS0tfpE12XQqMzbW7BWM=; b=U/59+i7vlBHHNea/kKLQr6YjVcDngZbmgHcGpmdGT07gg6cByg98rZVC3MWEBPyyN9 wPksBrc44tQ1stJ2JXwGH1O0T5eAzPPx1n8oX628+zWOG3FUFkzr6YfpqDQn632v7qsz Xms5eeoBrJ0J8DgbiH5qC4bvm5NWKAiMHfLi5ggFUJv2NrXFkpP+T5P3Gg8Px/Db++sb /C911XXa77TxeIkIzm80eleOvpp4+Q4gN6alEzwz9vqkRGFpXL5Vm03pWYCaltlzeKpk a+SLbBHp/fORA3mRWVWCIzgKNzZExlWDU7u5RbyxJcGPfIiHWRcpGwDB5B6YTbh16j01 hEFA== X-Gm-Message-State: AHPjjUh6cH0VsV5fblO+0qwjU0TwNsQPknDWismSQgZN7jgZnktTYRKA tgJSAZ5jJjv8eQoREpzsvNxKrA== X-Google-Smtp-Source: AOwi7QAATv94IbJX275ZSGhqSanVwO6jel+CmHj3g0tw1HTTFdfckzhwgpOjJHvVjXzOXl2sPe4a5A== X-Received: by 10.99.172.2 with SMTP id v2mr8045331pge.200.1506357284462; Mon, 25 Sep 2017 09:34:44 -0700 (PDT) Received: from localhost.localdomain ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id j1sm12004413pfc.169.2017.09.25.09.34.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2017 09:34:43 -0700 (PDT) From: Linus Walleij To: Dmitry Torokhov , linux-input@vger.kernel.org Cc: Hans-Christian Noren Egtvedt , Linus Walleij , devicetree@vger.kernel.org Subject: [PATCH 3/5 v2] input: mouse: Add DT bindings for GPIO mice Date: Mon, 25 Sep 2017 18:34:28 +0200 Message-Id: <20170925163430.22397-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170925163430.22397-1-linus.walleij@linaro.org> References: <20170925163430.22397-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. Acked-by: Hans-Christian Noren Egtvedt Cc: devicetree@vger.kernel.org Signed-off-by: Linus Walleij Acked-by: Rob Herring --- ChangeLog v1->v2: - Collect Hand-Christian's ACK - Uses 5-7 lines rather than 4-7 lines - Add suffix "-ms" to the scan interval property - Fix compatible string in the example --- .../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..519510a11af9 --- /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 5-7 GPIO lines. + +Required properties: + - compatible: must be "gpio-mouse" + - scan-interval-ms: 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-mouse"; + scan-interval-ms = <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>; +};