linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: mickib1@gmail.com
To: jkosina@suse.cz, rafi@seas.upenn.edu, chatty@enac.fr,
	peterhuewe@gmx.de, micki@n-trig.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/7] HID: N-trig MTM Driver fix and cleanup patch 2
Date: Mon,  8 Mar 2010 23:13:42 +0200	[thread overview]
Message-ID: <1268082827-2680-2-git-send-email-micki@n-trig.com> (raw)
In-Reply-To: <1268082827-2680-1-git-send-email-micki@n-trig.com>

From: micki <micki@micki-laptop.(none)>

Change ntrig_input_mapping function

N-trig is changing the way people interact with computers by providing a dual-mode pen and true multi-touch input device, specifically designed for today's advanced computing world.
N-trig DuoSense® solution provides a real Hands-on computing® experience, and sets the stage for OEMs and ISVs to introduce innovative computer products and applications for an intuitive, Hands-on® experience directly onscreen.
DuoSense digitizers are easily integrated into existing technologies, support all LCDs, keep devices slim and light, and can be implemented in a broad range of products, ranging from small notebooks to large LCDs.
N-trig has offices in Israel, the US, Taiwan and Japan.

Signed-off-by: Micki Balanga <micki@n-trig.com>
---
 drivers/hid/hid-ntrig.c |   23 +++++++++--------------
 1 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c
index e99342d..3602cd0 100644
--- a/drivers/hid/hid-ntrig.c
+++ b/drivers/hid/hid-ntrig.c
@@ -15,6 +15,7 @@
  *		do not have full multi touch support.
  *	1.1 - N-trig - Add Change Log and defines of MTM firmware.
  *		Add debug Paramater change Driver name in hid_driver structure
+ *	1.2 - N-trig - Change ntrig_input_mapping
  */
 
 /*
@@ -118,21 +119,12 @@ struct ntrig_data {
 	__u8 mt_foot_count;
 };
 
-/*
- * this driver is aimed at two firmware versions in circulation:
- *  - dual pen/finger single touch
- *  - finger multitouch, pen not working
- */
-
 static int ntrig_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 		struct hid_field *field, struct hid_usage *usage,
 		unsigned long **bit, int *max)
 {
-	/* No special mappings needed for the pen and single touch */
-	if (field->physical)
-		return 0;
-
 	switch (usage->hid & HID_USAGE_PAGE) {
+
 	case HID_UP_GENDESK:
 		switch (usage->hid) {
 		case HID_GD_X:
@@ -155,12 +147,15 @@ static int ntrig_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 	case HID_UP_DIGITIZER:
 		switch (usage->hid) {
 		/* we do not want to map these for now */
-		case HID_DG_CONTACTID: /* Not trustworthy, squelch for now */
+		case HID_DG_INVERT: /* value is always 0 */
+		case HID_DG_ERASER: /* value is always 0 */
+		case HID_DG_CONTACTID: /* value is useless */
+		case HID_DG_BARRELSWITCH:  /* doubtful */
 		case HID_DG_INPUTMODE:
 		case HID_DG_DEVICEINDEX:
+		case HID_DG_CONTACTCOUNT:
 		case HID_DG_CONTACTMAX:
 			return -1;
-
 		/* width/height mapped on TouchMajor/TouchMinor/Orientation */
 		case HID_DG_WIDTH:
 			hid_map_usage(hi, usage, bit, max,
@@ -169,8 +164,8 @@ static int ntrig_input_mapping(struct hid_device *hdev, struct hid_input *hi,
 		case HID_DG_HEIGHT:
 			hid_map_usage(hi, usage, bit, max,
 					EV_ABS, ABS_MT_TOUCH_MINOR);
-			input_set_abs_params(hi->input, ABS_MT_ORIENTATION,
-					0, 1, 0, 0);
+			hid_map_usage(hi, usage, bit, max,
+					EV_ABS, ABS_MT_TRACKING_ID);
 			return 1;
 		}
 		return 0;
-- 
1.6.3.3

  reply	other threads:[~2010-03-08 21:13 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-08 21:13 [PATCH 1/7] HID: N-trig MTM Driver fix and cleanup patch 1 mickib1
2010-03-08 21:13 ` mickib1 [this message]
2010-03-08 21:13   ` [PATCH 3/7] HID: N-trig MTM Driver fix And cleanup patch 3 mickib1
2010-03-08 21:13     ` [PATCH 4/7] HID: N-trig MTM Driver fix And cleanup Patch 4 mickib1
2010-03-08 21:13       ` [PATCH 5/7] HID: N-trig MTM Driver fix And cleanup patch 5 mickib1
2010-03-08 21:13         ` [PATCH 6/7] HID: N-trig MTM Driver fix And cleanup patch 6 mickib1
2010-03-09  1:20           ` Rafi Rubin
2010-03-09 10:15             ` Jiri Kosina
2010-03-09  1:29         ` [PATCH 5/7] HID: N-trig MTM Driver fix And cleanup patch 5 Rafi Rubin
2010-03-09  1:10       ` [PATCH 4/7] HID: N-trig MTM Driver fix And cleanup Patch 4 Rafi Rubin
2010-03-09  1:07   ` [PATCH 2/7] HID: N-trig MTM Driver fix and cleanup patch 2 Rafi Rubin
2010-03-09 15:43     ` Stéphane Chatty
2010-03-09  0:34 ` [PATCH 1/7] HID: N-trig MTM Driver fix and cleanup patch 1 Rafi Rubin
2010-03-09  0:50 ` Rafi Rubin
2010-03-09 10:11   ` Jiri Kosina
2010-03-09  8:43 ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1268082827-2680-2-git-send-email-micki@n-trig.com \
    --to=mickib1@gmail.com \
    --cc=chatty@enac.fr \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=micki@n-trig.com \
    --cc=peterhuewe@gmx.de \
    --cc=rafi@seas.upenn.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).