linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	linux-input@vger.kernel.org,
	Hans-Christian Noren Egtvedt <egtvedt@samfundet.no>
Cc: Linus Walleij <linus.walleij@linaro.org>, 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	[thread overview]
Message-ID: <20170917111445.30880-4-linus.walleij@linaro.org> (raw)
In-Reply-To: <20170917111445.30880-1-linus.walleij@linaro.org>

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 <linus.walleij@linaro.org>
---
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 <dt-bindings/gpio/gpio.h>
+
+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>;
+};
-- 
2.13.5


  parent reply	other threads:[~2017-09-17 11:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-17 11:14 [PATCH 0/5] Input: make the GPIO mouse useful Linus Walleij
2017-09-17 11:14 ` [PATCH 1/5] input: mouse: Kill off platform data for GPIO mouse Linus Walleij
2017-09-17 11:14 ` [PATCH 2/5] input: mouse: Rename GPIO mouse variables Linus Walleij
2017-09-17 11:14 ` Linus Walleij [this message]
2017-09-20 20:53   ` [PATCH 3/5] input: mouse: Add DT bindings for GPIO mice Rob Herring
2017-09-17 11:14 ` [PATCH 4/5] input: mouse: Convert GPIO mouse to use descriptors Linus Walleij
2017-09-21 21:18   ` Dmitry Torokhov
2017-09-17 11:14 ` [PATCH 5/5] input: mouse: Add device tree probing to GPIO mouse Linus Walleij
2017-09-17 12:44 ` [PATCH 0/5] Input: make the GPIO mouse useful Hans-Christian Noren Egtvedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170917111445.30880-4-linus.walleij@linaro.org \
    --to=linus.walleij@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=egtvedt@samfundet.no \
    --cc=linux-input@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).