Skip to contentSkip to conversation

bcm5974-0.62: Compatibility mode reverted, BTN_TOUCH event added

PATCH In review Henrik Rydberg 2 participants 4 messages Sep 2, 2008 – Sep 3, 2008

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

PATCH 1/1 bcm5974-0.62: Compatibility mode reverted, BTN_TOUCH event added

The mousedev driver requires the use of BTN_TOUCH events to process ABS_X and ABS_Y events properly, which is what is needed for the bcm5974-based apple computers to have a functional pointer out-of-the-box. This patch adds the BTN_TOUCH events to bcm5974.

---
 drivers/input/mouse/bcm5974.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/input/mouse/bcm5974.c +2 -0
index ae78bb8..cafbb71 100644
@@ -248,6 +248,7 @@ static void setup_events_to_report(struct input_dev *input_dev,
 				0, cfg->y.dim, cfg->y.fuzz, 0);
 
 	__set_bit(EV_KEY, input_dev->evbit);
+	__set_bit(BTN_TOUCH, input_dev->keybit);
 	__set_bit(BTN_TOOL_FINGER, input_dev->keybit);
 	__set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit);
 	__set_bit(BTN_TOOL_TRIPLETAP, input_dev->keybit);
@@ -296,6 +297,7 @@ static int report_tp_state(struct bcm5974 *dev, int size)
 
 	input_report_abs(input, ABS_PRESSURE, int2bound(&c->p, p));
 
+	input_report_key(input, BTN_TOUCH, p > 0);
 	input_report_key(input, BTN_TOOL_FINGER, n == 1);
 	input_report_key(input, BTN_TOOL_DOUBLETAP, n == 2);
 	input_report_key(input, BTN_TOOL_TRIPLETAP, n > 2);
Signature · 1 line
1.5.4.3
maintainer
#1 lore raw

drivers/input/mouse/bcm5974.c static int report_tp_state(struct bcm5974 *dev, int size) · line 300

Quoted 5 lines · Henrik Rydberg
drivers/input/mouse/bcm5974.c +1 -0
@@ -296,6 +297,7 @@ static int report_tp_state(struct bcm5974 *dev, int size)
 
 	input_report_abs(input, ABS_PRESSURE, int2bound(&c->p, p));
 
+	input_report_key(input, BTN_TOUCH, p > 0);

Just relying on p will probably make it too sensitive, have you tried adding hysteresis, like synaptics driver does?

Signature · 1 line
Dmitry
#2 lore raw
Quoted 10 lines · Dmitry Torokhov

drivers/input/mouse/bcm5974.c static int report_tp_state(struct bcm5974 *dev, int size) · line 300

Quoted 5 lines · Henrik Rydberg
drivers/input/mouse/bcm5974.c +1 -0
@@ -296,6 +297,7 @@ static int report_tp_state(struct bcm5974 *dev, int size)
 
 	input_report_abs(input, ABS_PRESSURE, int2bound(&c->p, p));
 
+	input_report_key(input, BTN_TOUCH, p > 0);

Just relying on p will probably make it too sensitive, have you tried adding hysteresis, like synaptics driver does?

I have, and the problem is somewhat more complicated when dealing with multiple fingers. The simple patch shown about actually works very well in practice. However, things can always improve. Yesterday I sent a second patch, bcm5974-0.63, which addressed this issue. However, the quality of the mouse movement has regressed a little in that patch. I would like to send yet another patch today, bcm5974-0.64, I hope this does not cause too much confusion.

Regarding mousedev, I noticed that the tap functionality does not distinguish between a tap (on/off localized in time and space) and a quick drag (on/off localized in time only).

maintainer
#3 lore raw
Quoted 12 lines · Henrik Rydberg
Quoted 10 lines · Dmitry Torokhov

drivers/input/mouse/bcm5974.c static int report_tp_state(struct bcm5974 *dev, int size) · line 300

Quoted 5 lines · Henrik Rydberg
drivers/input/mouse/bcm5974.c +1 -0
@@ -296,6 +297,7 @@ static int report_tp_state(struct bcm5974 *dev, int size)
 
 	input_report_abs(input, ABS_PRESSURE, int2bound(&c->p, p));
 
+	input_report_key(input, BTN_TOUCH, p > 0);

Just relying on p will probably make it too sensitive, have you tried adding hysteresis, like synaptics driver does?

Quoted 8 lines

I have, and the problem is somewhat more complicated when dealing with multiple fingers. The simple patch shown about actually works very well in practice. However, things can always improve. Yesterday I sent a second patch, bcm5974-0.63, which addressed this issue. However, the quality of the mouse movement has regressed a little in that patch. I would like to send yet another patch today, bcm5974-0.64, I hope this does not cause too much confusion.

That is fine.

Quoted 4 lines

Regarding mousedev, I noticed that the tap functionality does not distinguish between a tap (on/off localized in time and space) and a quick drag (on/off localized in time only).

Yes. Mousedev is a stop-gap measure and is to be used only while user installs proper driver. It does not need to be perfect.

Signature · 1 line
Dmitry