sh: maple: add support for the Maple mouse on the SEGA Dreamcast
Subsystems (3)
PATCH 1/1 sh: maple: add support for the Maple mouse on the SEGA Dreamcast
Here is a cleaned up version of the maple mouse driver - Dmitry, I tried using open and close functions as per the joystick but they seemed to get in the way of proper mouse operation. As it is the joystick does null out the callback pointer on removal of the driver, which seems to me to be the correct behaviour.
Add support for the Maple mouse on the SEGA Dreamcast.
---
drivers/input/mouse/Kconfig +11 -0
@@ -286,4 +286,15 @@ config MOUSE_GPIO 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 + help + This driver supports the Maple mouse on the SEGA Dreamcast. + + Most Dreamcast users, who have a mouse, will say Y here. + + To compile this driver as a module choose M here: the module will be + called maplemouse. + endif
drivers/input/mouse/Makefile +1 -0
@@ -17,6 +17,7 @@ obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o obj-$(CONFIG_MOUSE_HIL) += hil_ptr.o obj-$(CONFIG_MOUSE_VSXXXAA) += vsxxxaa.o obj-$(CONFIG_MOUSE_GPIO) += gpio_mouse.o +obj-$(CONFIG_MOUSE_MAPLE) += maplemouse.o psmouse-objs := psmouse-base.o synaptics.o
drivers/input/mouse/maplemouse.c new file +136 -0
136 lines not on this page · raw message
drivers/input/mouse/maplemouse.c line 104
Quoted 2 lines · On Monday 29 December 2008 14:17:25 Adrian McMenamin wrote:
drivers/input/mouse/maplemouse.c new file +2
-0+static int __devinit probe_maple_mouse(struct device *dev) +static int remove_maple_mouse(struct device *dev)
i thought you were going the rout of not labeling any of the probe/remove functions ... but if you label the prob with __devinit, then the remove should be __devexit. i.e. whichever way you go, the two should be consistent. -mike
Adding support for Maple mouse
---
drivers/input/mouse/Kconfig +11 -0
@@ -286,4 +286,15 @@ config MOUSE_GPIO 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 + help + This driver supports the Maple mouse on the SEGA Dreamcast. + + Most Dreamcast users, who have a mouse, will say Y here. + + To compile this driver as a module choose M here: the module will be + called maplemouse. + endif
drivers/input/mouse/Makefile +1 -0
@@ -17,6 +17,7 @@ obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o obj-$(CONFIG_MOUSE_HIL) += hil_ptr.o obj-$(CONFIG_MOUSE_VSXXXAA) += vsxxxaa.o obj-$(CONFIG_MOUSE_GPIO) += gpio_mouse.o +obj-$(CONFIG_MOUSE_MAPLE) += maplemouse.o psmouse-objs := psmouse-base.o synaptics.o
drivers/input/mouse/maplemouse.c new file +135 -0
135 lines not on this page · raw message
drivers/input/mouse/maplemouse.c line 120
Quoted 4 lines · On Monday 29 December 2008 16:30:14 Adrian McMenamin wrote:
drivers/input/mouse/maplemouse.c new file +4
-0+static int __devexit remove_maple_mouse(struct device *dev) +static struct maple_driver dc_mouse_driver = { + .drv = { + .remove = remove_maple_mouse,
does that really build warning free ? usually you need __devexit_p() in the .remove assignment ...
-mike
Quoted 9 lines · Mike Frysinger
drivers/input/mouse/maplemouse.c line 120
Quoted 4 lines · On Monday 29 December 2008 16:30:14 Adrian McMenamin wrote:
drivers/input/mouse/maplemouse.c new file +4
-0+static int __devexit remove_maple_mouse(struct device *dev) +static struct maple_driver dc_mouse_driver = { + .drv = { + .remove = remove_maple_mouse,does that really build warning free ? usually you need
__devexit_p()in the .remove assignment ...
-mike
Yep
adrian@bossclass:~/linux-2.6$ make ARCH=sh CROSS_COMPILE=/home/adrian/dreamy-linux/buildroot/build_sh4/staging_dir/bin/sh4-linux- zImage modules -j4 scripts/kconfig/conf -s arch/sh/Kconfig CHK include/linux/version.h SYMLINK include/asm -> include/asm-sh make[1]: `include/asm-sh/machtypes.h' is up to date. CHK include/linux/utsrelease.h UPD include/linux/utsrelease.h CALL scripts/checksyscalls.sh CHK include/linux/compile.h CC init/version.o CC kernel/module.o LD init/built-in.o CC [M] drivers/input/mouse/maplemouse.o LD kernel/built-in.o
Quoted 13 lines · Adrian McMenamin
Quoted 9 lines · Mike Frysinger
drivers/input/mouse/maplemouse.c line 120
Quoted 4 lines · On Monday 29 December 2008 16:30:14 Adrian McMenamin wrote:
drivers/input/mouse/maplemouse.c new file +4
-0+static int __devexit remove_maple_mouse(struct device *dev) +static struct maple_driver dc_mouse_driver = { + .drv = { + .remove = remove_maple_mouse,does that really build warning free ? usually you need
__devexit_p()in the .remove assignment ...
-mikeYep
Quoted 15 lines
adrian@bossclass:~/linux-2.6$ make ARCH=sh CROSS_COMPILE=/home/adrian/dreamy-linux/buildroot/build_sh4/staging_dir/bin/sh4-linux- zImage modules -j4 scripts/kconfig/conf -s arch/sh/Kconfig CHK include/linux/version.h SYMLINK include/asm -> include/asm-sh make[1]: `include/asm-sh/machtypes.h' is up to date. CHK include/linux/utsrelease.h UPD include/linux/utsrelease.h CALL scripts/checksyscalls.sh CHK include/linux/compile.h CC init/version.o CC kernel/module.o LD init/built-in.o CC [M] drivers/input/mouse/maplemouse.o LD kernel/built-in.o
Look for an increase in section mismatch warning or try to build with:
make CONFIG_DEBUG_SECTION_MISMATCH=y
Sam
Quoted 4 lines · Sam Ravnborg
Look for an increase in section mismatch warning or try to build with:
makeCONFIG_DEBUG_SECTION_MISMATCH=y
Just rebuilt the whole thing from scratch with that turned on and no extra warnings at all.
Quoted 7 lines · On Monday 29 December 2008 17:17:53 Adrian McMenamin wrote:
Quoted 3 lines · Sam Ravnborg
Look for an increase in section mismatch warning or try to build with:
makeCONFIG_DEBUG_SECTION_MISMATCH=yJust rebuilt the whole thing from scratch with that turned on and no extra warnings at all.
regardless, please add the aforementioned wrapping. this comes up from time to time in various configurations.
-mike
Dmitry Torokhov
maintainerQuoted 11 lines · On Monday 29 December 2008 14:19:42 Mike Frysinger wrote:
Quoted 7 lines · On Monday 29 December 2008 17:17:53 Adrian McMenamin wrote:
Quoted 3 lines · Sam Ravnborg
Look for an increase in section mismatch warning or try to build with:
makeCONFIG_DEBUG_SECTION_MISMATCH=yJust rebuilt the whole thing from scratch with that turned on and no extra warnings at all.
regardless, please add the aforementioned wrapping. this comes up from time to time in various configurations.
It could be that neither of the platforms this driver is running on defines CONFIG_HOTPLUG and then I think it is harmless but yes, we better have __devexit_p() there.
Signature · 1 line
Dmitry
Adding maple mouse with proper __devexit_p() handling
---
drivers/input/mouse/Kconfig +11 -0
@@ -286,4 +286,15 @@ config MOUSE_GPIO 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 + help + This driver supports the Maple mouse on the SEGA Dreamcast. + + Most Dreamcast users, who have a mouse, will say Y here. + + To compile this driver as a module choose M here: the module will be + called maplemouse. + endif
drivers/input/mouse/Makefile +1 -0
@@ -17,6 +17,7 @@ obj-$(CONFIG_MOUSE_SERIAL) += sermouse.o obj-$(CONFIG_MOUSE_HIL) += hil_ptr.o obj-$(CONFIG_MOUSE_VSXXXAA) += vsxxxaa.o obj-$(CONFIG_MOUSE_GPIO) += gpio_mouse.o +obj-$(CONFIG_MOUSE_MAPLE) += maplemouse.o psmouse-objs := psmouse-base.o synaptics.o
drivers/input/mouse/maplemouse.c new file +135 -0
135 lines not on this page · raw message
Mike Frysinger
Acked-byQuoted 1 line · On Tuesday 30 December 2008 15:27:05 Adrian McMenamin wrote:
Adding maple mouse with proper
__devexit_p()handling
this kind of patch revision info typically goes below the --- marker and the patch itself gets "v2", "v3", etc... header markers
otherwise, driver looks OK to me. thanks for your dreamcast work.
drivers/input/mouse/maplemouse.c line 60
Quoted 1 line
drivers/input/mouse/maplemouse.c new file +1
-0+ mse =kzalloc (sizeof (struct dc_mouse ),GFP_KERNEL );
personally i find this style less likely to rot:
mse = kzalloc(sizeof(*mse), GFP_KERNEL);
-mike