aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Bagwell <chris@cnpbagwell.com>2010-07-19 12:06:15 -0400
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2010-07-20 00:44:33 -0400
commit2a8e77102e02dd236ff276a2151073ed551d04f2 (patch)
treebddb91775388cc6591d84cea04cc5084ab28c45b
parentc18fb1396eb809dbc16e51da273a1789f9d799bf (diff)
Input: synaptics - only report width on hardware that supports it
Synaptics devices report fixed value of 5 for finger/palm widths on devices that do not support capability and driver further hardcodes to 5. Stop reporting this fixed value when its not supported since its not useful. This will aid applications so they can better auto-enable support for multi-touch emulation and palm detection logic using finger width only for devices that support width detection. I can find no applications that currently require existence on ABS_TOOL_WIDTH. Since only synaptics and bcm input devices currently support this tool, it seems they must handle it gracefully. Signed-off-by: Chris Bagwell <chris@cnpbagwell.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/mouse/synaptics.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 40cea334ad13..1b49d7f8ae11 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -496,7 +496,9 @@ static void synaptics_process_packet(struct psmouse *psmouse)
496 } 496 }
497 input_report_abs(dev, ABS_PRESSURE, hw.z); 497 input_report_abs(dev, ABS_PRESSURE, hw.z);
498 498
499 input_report_abs(dev, ABS_TOOL_WIDTH, finger_width); 499 if (SYN_CAP_PALMDETECT(priv->capabilities))
500 input_report_abs(dev, ABS_TOOL_WIDTH, finger_width);
501
500 input_report_key(dev, BTN_TOOL_FINGER, num_fingers == 1); 502 input_report_key(dev, BTN_TOOL_FINGER, num_fingers == 1);
501 input_report_key(dev, BTN_LEFT, hw.left); 503 input_report_key(dev, BTN_LEFT, hw.left);
502 input_report_key(dev, BTN_RIGHT, hw.right); 504 input_report_key(dev, BTN_RIGHT, hw.right);
@@ -596,7 +598,9 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
596 input_set_abs_params(dev, ABS_Y, 598 input_set_abs_params(dev, ABS_Y,
597 YMIN_NOMINAL, priv->y_max ?: YMAX_NOMINAL, 0, 0); 599 YMIN_NOMINAL, priv->y_max ?: YMAX_NOMINAL, 0, 0);
598 input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0); 600 input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0);
599 __set_bit(ABS_TOOL_WIDTH, dev->absbit); 601
602 if (SYN_CAP_PALMDETECT(priv->capabilities))
603 __set_bit(ABS_TOOL_WIDTH, dev->absbit);
600 604
601 __set_bit(EV_KEY, dev->evbit); 605 __set_bit(EV_KEY, dev->evbit);
602 __set_bit(BTN_TOUCH, dev->keybit); 606 __set_bit(BTN_TOUCH, dev->keybit);