Skip to contentSkip to conversation

Input: gpio_mouse - remove driver that has never been used in the kernel

PATCH In review Ethan Nelson-Moore 4 participants 5 messages Sep 19 – Sep 21

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: gpio_mouse - remove driver that has never been used in the kernel

The gpio_mouse driver was added in 2007, but it has never been referenced by any platform data or DTS files in the kernel, and it does not support ACPI probing. Therefore, it has clearly never been used by any users of unmodified mainline Linux. Remove it.

---
 .../driver-api/gpio/drivers-on-gpio.rst       |   5 -
 drivers/input/mouse/Kconfig                   |  15 --
 drivers/input/mouse/Makefile                  |   1 -
 drivers/input/mouse/gpio_mouse.c              | 170 ------------------
 4 files changed, 191 deletions(-)
 delete mode 100644 drivers/input/mouse/gpio_mouse.c
Documentation/driver-api/gpio/drivers-on-gpio.rst +0 -5
index 95572d2a94ce..e386d909bc08 100644
@@ -21,11 +21,6 @@ hardware descriptions such as device tree or ACPI:
   GPIO line cannot generate interrupts, so it needs to be periodically polled
   by a timer.
 
-- gpio_mouse: drivers/input/mouse/gpio_mouse.c is used to provide a mouse with
-  up to three buttons by simply using GPIOs and no mouse port. You can cut the
-  mouse cable and connect the wires to GPIO lines or solder a mouse connector
-  to the lines for a more permanent solution of this type.
-
 - gpio-beeper: drivers/input/misc/gpio-beeper.c is used to provide a beep from
   an external speaker connected to a GPIO line. (If the beep is controlled by
   off/on, for an actual PWM waveform, see pwm-gpio below.)
drivers/input/mouse/Kconfig +0 -15
index 074130d88953..5f2466c08b9a 100644
@@ -332,21 +332,6 @@ config MOUSE_VSXXXAA
 	  described in the source file). This driver also works with the
 	  digitizer (VSXXX-AB) DEC produced.
 
-config MOUSE_GPIO
-	tristate "GPIO mouse"
-	depends on GPIOLIB || COMPILE_TEST
-	help
-	  This driver simulates a mouse on GPIO lines of various CPUs (and some
-	  other chips).
-
-	  Say Y here if your device has buttons or a simple joystick connected
-	  directly to GPIO lines. Your board-specific setup logic must also
-	  provide a platform device and platform data saying which GPIOs are
-	  used.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called gpio_mouse.
-
 config MOUSE_MAPLE
 	tristate "Maple mouse (for the Dreamcast)"
 	depends on MAPLE
drivers/input/mouse/Makefile +0 -1
index ed40f141691e..52c0a99853b0 100644
@@ -11,7 +11,6 @@ obj-$(CONFIG_MOUSE_ATARI)		+= atarimouse.o
 obj-$(CONFIG_MOUSE_BCM5974)		+= bcm5974.o
 obj-$(CONFIG_MOUSE_CYAPA)		+= cyapatp.o
 obj-$(CONFIG_MOUSE_ELAN_I2C)		+= elan_i2c.o
-obj-$(CONFIG_MOUSE_GPIO)		+= gpio_mouse.o
 obj-$(CONFIG_MOUSE_MAPLE)		+= maplemouse.o
 obj-$(CONFIG_MOUSE_PS2)			+= psmouse.o
 obj-$(CONFIG_MOUSE_RISCPC)		+= rpcmouse.o
drivers/input/mouse/gpio_mouse.c deleted +0 -170

170 lines not on this page · raw message

Signature · 1 line
2.43.0
#1 lore raw
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider: - [Medium] input: gpio_mouse: driver removal speculatively breaks device tree ABI - [Low] input…

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [Medium] input: gpio_mouse: driver removal speculatively breaks device tree ABI
- [Low] input: gpio_mouse: incomplete cleanup leaves orphaned DT binding
--

commit ff6ae0c9a42236905d35103b1b6b9ce3be08070e
Author: Ethan Nelson-Moore <[email protected]>

Input: gpio_mouse - remove driver that has never been used in the kernel

This commit removes the gpio_mouse driver. The driver has been present since 2007 but lacks any in-tree references from platform data, device tree files, or ACPI probing.

Quoted 6 lines
drivers/input/mouse/gpio_mouse.c deleted +0 -0
deleted file mode 100644
index 18ccbd45004ad..0000000000000
@@ -1,170 +0,0 @@

[ ... ]

drivers/input/mouse/gpio_mouse.c line 156

Quoted 5 lines
drivers/input/mouse/gpio_mouse.c deleted +0 -5
-static const struct of_device_id gpio_mouse_of_match[] = {
-	{ .compatible = "gpio-mouse", },
-	{ },
-};
-MODULE_DEVICE_TABLE(of, gpio_mouse_of_match);

[Severity: Medium]
Could removing this driver break the Device Tree ABI for any out-of-tree boards that currently rely on the "gpio-mouse" compatible string?

If a system bootloader or firmware passes a DTB with the "gpio-mouse" compatible string, the driver will no longer exist to bind to it.

[Severity: Low]
Does this patch also need to remove the devicetree binding schema for "gpio-mouse"?

The schema file Documentation/devicetree/bindings/input/gpio-mouse.yaml appears to be left behind, leaving it as an orphaned document now that the driver is removed.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
maintainer
#2 lore raw
In reply to Ethan Nelson-Moore
Quoted 6 lines · Ethan Nelson-Moore

The gpio_mouse driver was added in 2007, but it has never been referenced by any platform data or DTS files in the kernel, and it does not support ACPI probing. Therefore, it has clearly never been used by any users of unmodified mainline Linux. Remove it.

Why though? It is fully modernized and probably has a value for people like "makers" who just want to connect an oldschool mouse to their random Raspberry Pi.

I think it's better if we focus on removing code that is just using platform devices and hacks and is hopeless
to maintain. For example the OLPC...

Yours,
Linus Walleij

#3 lore raw

Hi, Linus,

Quoted 3 lines · Linus Walleij

Why though? It is fully modernized and probably has a value for people like "makers" who just want to connect an oldschool mouse to their random Raspberry Pi.

You're right. The driver is so small, too.

Quoted 3 lines

I think it's better if we focus on removing code that is just using platform devices and hacks and is hopeless
to maintain. For example the OLPC...

That's a good idea. I've started working on a patch to remove OLPC support - at least 6500 lines of code and I'm not even done yet!

Ethan

#4 lore raw
In reply to Linus Walleij
Quoted 10 lines · Linus Walleij
Quoted 6 lines · Ethan Nelson-Moore

The gpio_mouse driver was added in 2007, but it has never been referenced by any platform data or DTS files in the kernel, and it does not support ACPI probing. Therefore, it has clearly never been used by any users of unmodified mainline Linux. Remove it.

Quoted 8 lines

Why though? It is fully modernized and probably has a value for people like "makers" who just want to connect an oldschool mouse to their random Raspberry Pi.

I think it's better if we focus on removing code that is just using platform devices and hacks and is hopeless
to maintain. For example the OLPC...

Agreed. I support removing drivers tied to specific architectures that were also removed but this is very generic and may see some use.

Bart