Re: [PATCH 2/2] input: bcm5974-0.61: New default mouse driver mode

Previous thread: [PATCH 1/2] input: Cleanup for new scripts/checkpatch.pl by Henrik Rydberg on Monday, September 1, 2008 - 1:05 pm. (1 message)

Next thread: Misc fixes for 2.6.27 by David Woodhouse on Monday, September 1, 2008 - 1:14 pm. (17 messages)
From: Henrik Rydberg
Date: Monday, September 1, 2008 - 1:08 pm

Currently, the Apple bcm5974 driver only mimics a synaptics touchpad, not a mouse.
This creates unnecessary complications on systems where the synaptics driver is absent
or not configured, such as in a completely new system, or a text console. This patch
provides a default compatibility configuration, which works as a multi-button mouse,
implemented using rudimentary multi-finger options. It yields the following benefits:

* A default Xorg configuration will pick up the mouse input interface, resulting in a
functional mouse pointer out-of-the-box on many systems.

* Two-finger scroll emulates a mouse wheel.

* Three-finger swipe emulates a horizontal mouse wheel.

* Multi-finger clicks emulate the middle and right mouse buttons.

* The mouse driver also works with gpm in text consoles, providing cut-and-paste functionality.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
---
 drivers/input/mouse/bcm5974.c |  238 ++++++++++++++++++++++++++++++++++------
 1 files changed, 202 insertions(+), 36 deletions(-)

diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index ae78bb8..7e18793 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -84,10 +84,33 @@ MODULE_LICENSE("GPL");
 #define dprintk(level, format, a...)\
 	{ if (debug >= level) printk(KERN_DEBUG format, ##a); }

+#define MODE_MOUSE	1
+#define MODE_TOUCHPAD	2
+
 static int debug = 1;
 module_param(debug, int, 0644);
 MODULE_PARM_DESC(debug, "Activate debugging output");

+static int driver_mode = MODE_MOUSE;
+module_param(driver_mode, int, 0644);
+MODULE_PARM_DESC(driver_mode, "Driver mode (1 - mouse; 2 - touchpad)");
+
+static int mouse_motion_damping = 8;
+module_param(mouse_motion_damping, int, 0644);
+MODULE_PARM_DESC(mouse_motion_damping, "Mouse motion damping");
+
+static int mouse_wheel_damping = 256;
+module_param(mouse_wheel_damping, int, 0644);
+MODULE_PARM_DESC(mouse_wheel_damping, "Vertical mouse wheel damping");
+
+static int ...
From: Dmitry Torokhov
Date: Tuesday, September 2, 2008 - 6:00 am

Hi Henrik,


Mousedev should provide a reasonable emulation of standard mouse
giving user chance to configure the system properly. There is no need
to task the driver to provide such emulation and therefore I will not

This happens automatically with Synaptics hardware on newer
distributions (at least Fedora 9 does this). As far as I know
SYnaptics driver does no look for specific product but for a certain

The kenel driver should only do as little translation as possible,

Does not mousedev emulation work from GPM? Also GPM has evdev protocol
support which should work very well with synaptics-like touchpads.

-- 
Dmitry
--

From: Henrik Rydberg
Date: Tuesday, September 2, 2008 - 11:23 am

I see, this is what puzzled me. Currently mousedev does not work with
bcm5974, but given the statement that it should, it was not hard finding
the reason; the ABS_X/Y messages get stuck in mousedev because bcm5974 does
not fire BTN_TOUCH events. I will send a fix for it shortly. I take it the

One could argue that those features are basic rather than fancy; virtually
every mouse of today provides equivalent functionality, and multitouch
features are here to stay. It is also discouraging in particular to
first-time apple users, having to spend a lot of time configuring their
system, only to be able to right-click or scroll using the trackpad.
Could it be something for the mousedev driver, perhaps?


Many thanks,
Henrik

--

Previous thread: [PATCH 1/2] input: Cleanup for new scripts/checkpatch.pl by Henrik Rydberg on Monday, September 1, 2008 - 1:05 pm. (1 message)

Next thread: Misc fixes for 2.6.27 by David Woodhouse on Monday, September 1, 2008 - 1:14 pm. (17 messages)