FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu Kernel Team

 
 
LinkBack Thread Tools
 
Old 05-24-2010, 01:54 PM
Chase Douglas
 
Default HID: ntrig: TipSwitch for single touch mode touch.

From: Rafi Rubin <rafi@seas.upenn.edu>

Include TipSwitch in the touch detection decision for some single touch
firmwares. Confidence and InRange are high for all finger events
including those used to indicate the finger is no longer in contact with
the sensor.

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
(cherry picked from commit 250d377522fd81459a4ea2350a794b453f37ce7d)

BugLink: http://bugs.launchpad.net/bugs/583531

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
---
drivers/hid/hid-ntrig.c | 29 +++++++++++++++++++++--------
1 files changed, 21 insertions(+), 8 deletions(-)

diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c
index ff605dd..89facfd 100644
--- a/drivers/hid/hid-ntrig.c
+++ b/drivers/hid/hid-ntrig.c
@@ -30,10 +30,12 @@ struct ntrig_data {
/* Incoming raw values for a single contact */
__u16 x, y, w, h;
__u16 id;
- __u8 confidence;
+
+ bool tipswitch;
+ bool confidence;
+ bool first_contact_touch;

bool reading_mt;
- __u8 first_contact_confidence;

__u8 mt_footer[4];
__u8 mt_foot_count;
@@ -140,9 +142,10 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field,
case 0xff000001:
/* Tag indicating the start of a multitouch group */
nd->reading_mt = 1;
- nd->first_contact_confidence = 0;
+ nd->first_contact_touch = 0;
break;
case HID_DG_TIPSWITCH:
+ nd->tipswitch = value;
/* Prevent emission of touch until validated */
return 1;
case HID_DG_CONFIDENCE:
@@ -170,10 +173,14 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field,
* to emit a normal (X, Y) position
*/
if (!nd->reading_mt) {
- input_report_key(input, BTN_TOOL_DOUBLETAP,
- (nd->confidence != 0));
+ /*
+ * TipSwitch indicates the presence of a
+ * finger in single touch mode.
+ */
input_report_key(input, BTN_TOUCH,
- (nd->confidence != 0));
+ nd->tipswitch);
+ input_report_key(input, BTN_TOOL_DOUBLETAP,
+ nd->tipswitch);
input_event(input, EV_ABS, ABS_X, nd->x);
input_event(input, EV_ABS, ABS_Y, nd->y);
}
@@ -212,7 +219,13 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field,

/* emit a normal (X, Y) for the first point only */
if (nd->id == 0) {
- nd->first_contact_confidence = nd->confidence;
+ /*
+ * TipSwitch is superfluous in multitouch
+ * mode. The footer events tell us
+ * if there is a finger on the screen or
+ * not.
+ */
+ nd->first_contact_touch = nd->confidence;
input_event(input, EV_ABS, ABS_X, nd->x);
input_event(input, EV_ABS, ABS_Y, nd->y);
}
@@ -242,7 +255,7 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field,

nd->reading_mt = 0;

- if (nd->first_contact_confidence) {
+ if (nd->first_contact_touch) {
switch (value) {
case 0: /* for single touch devices */
case 1:
--
1.7.0.4


--
kernel-team mailing list
kernel-team@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/kernel-team
 

Thread Tools




All times are GMT. The time now is 09:46 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org