Skip to content

Commit

Permalink
Input: synaptics - only report width on hardware that supports it
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Chris Bagwell authored and Dmitry Torokhov committed Jul 20, 2010
1 parent c18fb13 commit 2a8e771
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/input/mouse/synaptics.c
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,9 @@ static void synaptics_process_packet(struct psmouse *psmouse)
}
input_report_abs(dev, ABS_PRESSURE, hw.z);

input_report_abs(dev, ABS_TOOL_WIDTH, finger_width);
if (SYN_CAP_PALMDETECT(priv->capabilities))
input_report_abs(dev, ABS_TOOL_WIDTH, finger_width);

input_report_key(dev, BTN_TOOL_FINGER, num_fingers == 1);
input_report_key(dev, BTN_LEFT, hw.left);
input_report_key(dev, BTN_RIGHT, hw.right);
Expand Down Expand Up @@ -596,7 +598,9 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
input_set_abs_params(dev, ABS_Y,
YMIN_NOMINAL, priv->y_max ?: YMAX_NOMINAL, 0, 0);
input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0);
__set_bit(ABS_TOOL_WIDTH, dev->absbit);

if (SYN_CAP_PALMDETECT(priv->capabilities))
__set_bit(ABS_TOOL_WIDTH, dev->absbit);

__set_bit(EV_KEY, dev->evbit);
__set_bit(BTN_TOUCH, dev->keybit);
Expand Down

0 comments on commit 2a8e771

Please sign in to comment.