1 commit e42b6646a8298fe06a33a0f68dab661335f5db6e
2 Author: Peter Hutterer <peter.hutterer@who-t.net>
3 Date: Thu Nov 20 15:24:42 2008 -0500
5 Input: synaptics - report multi-taps only if supported by the device
7 According to Section 2.4.4 of the Synaptics TouchPad Interfacing
8 Guide, bit 2 specifies if multi-finger detection is provided by
9 the touchpad. Thus, only set BTN_TOOL_DOUBLETAP and
10 BTN_TOOL_TRIPLETAP if the device actually supports it.
12 Signed-off-by: Peter Hutterer <peter.hutterer@redhat.com>
13 Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
15 diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
16 index d349c4a..865fc69 100644
17 --- a/drivers/input/mouse/synaptics.c
18 +++ b/drivers/input/mouse/synaptics.c
19 @@ -445,12 +445,14 @@ static void synaptics_process_packet(struct psmouse *psmouse)
21 input_report_abs(dev, ABS_TOOL_WIDTH, finger_width);
22 input_report_key(dev, BTN_TOOL_FINGER, num_fingers == 1);
23 - input_report_key(dev, BTN_TOOL_DOUBLETAP, num_fingers == 2);
24 - input_report_key(dev, BTN_TOOL_TRIPLETAP, num_fingers == 3);
26 input_report_key(dev, BTN_LEFT, hw.left);
27 input_report_key(dev, BTN_RIGHT, hw.right);
29 + if (SYN_CAP_MULTIFINGER(priv->capabilities)) {
30 + input_report_key(dev, BTN_TOOL_DOUBLETAP, num_fingers == 2);
31 + input_report_key(dev, BTN_TOOL_TRIPLETAP, num_fingers == 3);
34 if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities))
35 input_report_key(dev, BTN_MIDDLE, hw.middle);
37 @@ -543,12 +545,14 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
38 set_bit(EV_KEY, dev->evbit);
39 set_bit(BTN_TOUCH, dev->keybit);
40 set_bit(BTN_TOOL_FINGER, dev->keybit);
41 - set_bit(BTN_TOOL_DOUBLETAP, dev->keybit);
42 - set_bit(BTN_TOOL_TRIPLETAP, dev->keybit);
44 set_bit(BTN_LEFT, dev->keybit);
45 set_bit(BTN_RIGHT, dev->keybit);
47 + if (SYN_CAP_MULTIFINGER(priv->capabilities)) {
48 + set_bit(BTN_TOOL_DOUBLETAP, dev->keybit);
49 + set_bit(BTN_TOOL_TRIPLETAP, dev->keybit);
52 if (SYN_CAP_MIDDLE_BUTTON(priv->capabilities))
53 set_bit(BTN_MIDDLE, dev->keybit);