Bugzilla – Attachment 324021 Details for
Bug 548463
N-trig driver is obsolete
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Forgot Password
[patch]
patch
patch (text/plain), 4.13 KB, created by
Stefan Dirsch
on 2009-10-25 03:36:10 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Stefan Dirsch
Created:
2009-10-25 03:36:10 UTC
Size:
4.13 KB
patch
obsolete
>From 837b47533a6476ab3fb96b1f52edd3ce9f3162b8 Mon Sep 17 00:00:00 2001 >From: Rafi Rubin <rafi@seas.upenn.edu> >Date: Tue, 23 Jun 2009 14:09:26 -0400 >Subject: [PATCH 1/2] HID: ntrig tool separation and pen usages > >When both touch and pen are active send a tool announcement before >sending any status changes so that event users may differentiate >which tool is changing. > >Restored three usage codes used by the pen. > >Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu> >Acked-by: Stephane Chatty <chatty@enac.fr> >Signed-off-by: Jiri Kosina <jkosina@suse.cz> >--- > drivers/hid/hid-ntrig.c | 33 +++++++++++++++++++++++++++++---- > 1 files changed, 29 insertions(+), 4 deletions(-) > >diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c >index 75ed9d2..d7b3e61 100644 >--- a/drivers/hid/hid-ntrig.c >+++ b/drivers/hid/hid-ntrig.c >@@ -27,6 +27,9 @@ > struct ntrig_data { > __s32 x, y, id, w, h; > char reading_a_point, found_contact_id; >+ char pen_active; >+ char finger_active; >+ char inverted; > }; > > /* >@@ -63,10 +66,7 @@ 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_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: >@@ -125,6 +125,18 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, > > if (hid->claimed & HID_CLAIMED_INPUT) { > switch (usage->hid) { >+ >+ case HID_DG_INRANGE: >+ if (field->application & 0x3) >+ nd->pen_active = (value != 0); >+ else >+ nd->finger_active = (value != 0); >+ return 0; >+ >+ case HID_DG_INVERT: >+ nd->inverted = value; >+ return 0; >+ > case HID_GD_X: > nd->x = value; > nd->reading_a_point = 1; >@@ -147,7 +159,11 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, > * report received in a finger event. We want > * to emit a normal (X, Y) position > */ >- if (! nd->found_contact_id) { >+ if (!nd->found_contact_id) { >+ if (nd->pen_active && nd->finger_active) { >+ input_report_key(input, BTN_TOOL_DOUBLETAP, 0); >+ input_report_key(input, BTN_TOOL_DOUBLETAP, 1); >+ } > input_event(input, EV_ABS, ABS_X, nd->x); > input_event(input, EV_ABS, ABS_Y, nd->y); > } >@@ -159,6 +175,14 @@ static int ntrig_event (struct hid_device *hid, struct hid_field *field, > * to emit a normal (X, Y) position > */ > if (! nd->found_contact_id) { >+ if (nd->pen_active && nd->finger_active) { >+ input_report_key(input, >+ nd->inverted ? BTN_TOOL_RUBBER : BTN_TOOL_PEN >+ , 0); >+ input_report_key(input, >+ nd->inverted ? BTN_TOOL_RUBBER : BTN_TOOL_PEN >+ , 1); >+ } > input_event(input, EV_ABS, ABS_X, nd->x); > input_event(input, EV_ABS, ABS_Y, nd->y); > input_event(input, EV_ABS, ABS_PRESSURE, value); >@@ -233,6 +257,7 @@ static int ntrig_probe(struct hid_device *hdev, const struct hid_device_id *id) > > if (ret) > kfree (nd); >+ > return ret; > } > >-- >1.6.4.2 > > >From a24f423bdf253ccee369adc6c5451b40a0716fbb Mon Sep 17 00:00:00 2001 >From: Peter Huewe <peterhuewe@gmx.de> >Date: Thu, 2 Jul 2009 19:08:38 +0200 >Subject: [PATCH 2/2] HID: adding __init/__exit macros to module init/exit functions > >Trivial patch which adds the __init and __exit macros to the module_init / >module_exit functions of several HID drivers from drivers/hid/ > >Signed-off-by: Peter Huewe <peterhuewe@gmx.de> >Signed-off-by: Jiri Kosina <jkosina@suse.cz> >--- > drivers/hid/hid-ntrig.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > >diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c >index d7b3e61..49ce69d 100644 >--- a/drivers/hid/hid-ntrig.c >+++ b/drivers/hid/hid-ntrig.c >@@ -290,12 +290,12 @@ static struct hid_driver ntrig_driver = { > .event = ntrig_event, > }; > >-static int ntrig_init(void) >+static int __init ntrig_init(void) > { > return hid_register_driver(&ntrig_driver); > } > >-static void ntrig_exit(void) >+static void __exit ntrig_exit(void) > { > hid_unregister_driver(&ntrig_driver); > } >-- >1.6.4.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 548463
: 324021