* [PATCH 1/2] input: synaptics - only report width on hardware that supports it
@ 2010-07-18 19:06 chris
2010-07-18 19:06 ` [PATCH 2/2] input: synaptics - set min/max for finger width chris
2010-07-19 16:07 ` [PATCH 1/2] input: synaptics - only report width on hardware that supports it Dmitry Torokhov
0 siblings, 2 replies; 3+ messages in thread
From: chris @ 2010-07-18 19:06 UTC (permalink / raw)
To: linux-input; +Cc: Chris Bagwell
From: Chris Bagwell <chris@cnpbagwell.com>
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>
---
drivers/input/mouse/synaptics.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 40cea33..1b49d7f 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)
}
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);
@@ -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);
--
1.7.1.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] input: synaptics - set min/max for finger width
2010-07-18 19:06 [PATCH 1/2] input: synaptics - only report width on hardware that supports it chris
@ 2010-07-18 19:06 ` chris
2010-07-19 16:07 ` [PATCH 1/2] input: synaptics - only report width on hardware that supports it Dmitry Torokhov
1 sibling, 0 replies; 3+ messages in thread
From: chris @ 2010-07-18 19:06 UTC (permalink / raw)
To: linux-input; +Cc: Chris Bagwell
From: Chris Bagwell <chris@cnpbagwell.com>
Reporting this will allow GUI config apps to correctly scale
width sensitive config values (such as palm detect) to correct range.
Current user apps are detecting kernels min/max=0/0 and making
an assumption that it means 0/16 or 0/15.
Synaptics touchpad interface guides show 4/15 are correct values
but driver forces to 0 when no fingers on touchpad.
Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
---
drivers/input/mouse/synaptics.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 1b49d7f..85a1e14 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -600,7 +600,7 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0);
if (SYN_CAP_PALMDETECT(priv->capabilities))
- __set_bit(ABS_TOOL_WIDTH, dev->absbit);
+ input_set_abs_params(dev, ABS_TOOL_WIDTH, 0, 15, 0, 0);
__set_bit(EV_KEY, dev->evbit);
__set_bit(BTN_TOUCH, dev->keybit);
--
1.7.1.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] input: synaptics - only report width on hardware that supports it
2010-07-18 19:06 [PATCH 1/2] input: synaptics - only report width on hardware that supports it chris
2010-07-18 19:06 ` [PATCH 2/2] input: synaptics - set min/max for finger width chris
@ 2010-07-19 16:07 ` Dmitry Torokhov
1 sibling, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2010-07-19 16:07 UTC (permalink / raw)
To: chris; +Cc: linux-input
On Sun, Jul 18, 2010 at 02:06:06PM -0500, chris@cnpbagwell.com wrote:
> From: Chris Bagwell <chris@cnpbagwell.com>
>
> 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>
Applied both, thanks Chris.
--
Dmitry
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-19 16:07 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-18 19:06 [PATCH 1/2] input: synaptics - only report width on hardware that supports it chris
2010-07-18 19:06 ` [PATCH 2/2] input: synaptics - set min/max for finger width chris
2010-07-19 16:07 ` [PATCH 1/2] input: synaptics - only report width on hardware that supports it Dmitry Torokhov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).