mbox series

[0/5] Input: make the GPIO mouse useful

Message ID 20170917111445.30880-1-linus.walleij@linaro.org
Headers show
Series Input: make the GPIO mouse useful | expand

Message

Linus Walleij Sept. 17, 2017, 11:14 a.m. UTC
The GPIO mouse device does not have any in-kernel users.

This series converts it to use descriptors, adds device tree
bindings and adds device tree probing so it can be used for
embedded target etc without proper mouse ports.

An alternative is to simply delete the driver. But I took
pity in it and I am also worried that the number of out-of-tree
users could be pretty large.

Hans-Christian: can you express your idea for the future of
this driver? Does this look all right to you? Do you want to
add some users in some device trees maybe?

Linus Walleij (5):
  input: mouse: Kill off platform data for GPIO mouse
  input: mouse: Rename GPIO mouse variables
  input: mouse: Add DT bindings for GPIO mice
  input: mouse: Convert GPIO mouse to use descriptors
  input: mouse: Add device tree probing to GPIO mouse

 .../devicetree/bindings/input/gpio-mouse.txt       |  32 ++++
 drivers/input/mouse/gpio_mouse.c                   | 195 +++++++++++----------
 include/linux/gpio_mouse.h                         |  61 -------
 3 files changed, 130 insertions(+), 158 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/input/gpio-mouse.txt
 delete mode 100644 include/linux/gpio_mouse.h

-- 
2.13.5

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Hans-Christian Noren Egtvedt Sept. 17, 2017, 12:44 p.m. UTC | #1
Around Sun 17 Sep 2017 13:14:40 +0200 or thereabout, Linus Walleij wrote:
> The GPIO mouse device does not have any in-kernel users.

> 

> This series converts it to use descriptors, adds device tree

> bindings and adds device tree probing so it can be used for

> embedded target etc without proper mouse ports.

> 

> An alternative is to simply delete the driver. But I took

> pity in it and I am also worried that the number of out-of-tree

> users could be pretty large.

> 

> Hans-Christian: can you express your idea for the future of

> this driver? Does this look all right to you? Do you want to

> add some users in some device trees maybe?


I had completely forgotten about this driver. IIRC we used it quite a lot on
various stages of development for Atmel's AVR32 processors, an architecture
now removed from the kernel.

I have found it quite useful when needing a simple input mouse like device on
embedded systems, so hopefully it is of value for other users.

OTOH, I have not used this driver for years, but if somebody do occasionally
use it, I do not mind it staying around. If the majority of people want it
out, then I will not object that either.

> Linus Walleij (5):

>   input: mouse: Kill off platform data for GPIO mouse

>   input: mouse: Rename GPIO mouse variables

>   input: mouse: Add DT bindings for GPIO mice

>   input: mouse: Convert GPIO mouse to use descriptors

>   input: mouse: Add device tree probing to GPIO mouse

> 

>  .../devicetree/bindings/input/gpio-mouse.txt       |  32 ++++

>  drivers/input/mouse/gpio_mouse.c                   | 195 +++++++++++----------

>  include/linux/gpio_mouse.h                         |  61 -------

>  3 files changed, 130 insertions(+), 158 deletions(-)

>  create mode 100644 Documentation/devicetree/bindings/input/gpio-mouse.txt

>  delete mode 100644 include/linux/gpio_mouse.h


Good work, this driver is a lot more usable rewritten to support device tree
instead of platform data. I would assume any 4.14++ kernel users is over on
device tree anyway.

Acked-by: Hans-Christian Noren Egtvedt <egtvedt@samfundet.no> on these five

patches.

-- 
mvh
Hans-Christian Noren Egtvedt
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rob Herring Sept. 20, 2017, 8:53 p.m. UTC | #2
On Sun, Sep 17, 2017 at 01:14:43PM +0200, Linus Walleij wrote:
> 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.


In userspace? Doesn't seem like common h/w or that it would work well.

> ---

>  .../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.


Presumably we have to have 1 button, so 5-7 lines?

> +

> +Required properties:

> +	- compatible: must be "gpio-mouse"

> +	- scan-interval: The scanning interval in milliseconds


Add a unit suffix. Unless we can gain something sharing this with other 
input bindings.

> +	- 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";


copy-n-paste error.

> +	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

> 

> --

> To unsubscribe from this list: send the line "unsubscribe devicetree" in

> the body of a message to majordomo@vger.kernel.org

> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html