]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/blob
a58990ef8052c95ab511983ffebac23dbe731875
[thirdparty/openembedded/openembedded-core-contrib.git] /
1 From 3589c3e0ec88c19c330b88f7d37c8092987866e6 Mon Sep 17 00:00:00 2001
2 From: Priya Vijayan <priya.vijayan@intel.com>
3 Date: Fri, 30 Apr 2010 11:11:10 -0700
4 Subject: [PATCH] Enable hid-dg-contactcount in stantum and cando touch drivers
5
6 Enable hid-dg-contact count in stantum and cando touch drivers to be able to use with mtdev driver
7
8 Patch-mainline: 2.6.34
9
10 Signed-off-by: Priya Vijayan <priya.vijayan@intel.com>
11 ---
12 drivers/hid/hid-cando.c | 8 ++++++++
13 drivers/hid/hid-stantum.c | 11 ++++++++++-
14 2 files changed, 18 insertions(+), 1 deletions(-)
15
16 diff --git a/drivers/hid/hid-cando.c b/drivers/hid/hid-cando.c
17 index ed8c093..42b9980 100644
18 --- a/drivers/hid/hid-cando.c
19 +++ b/drivers/hid/hid-cando.c
20 @@ -64,6 +64,10 @@ static int cando_input_mapping(struct hid_device *hdev, struct hid_input *hi,
21 case HID_DG_TIPSWITCH:
22 case HID_DG_CONTACTMAX:
23 return -1;
24 + case HID_DG_CONTACTCOUNT:
25 + hid_map_usage(hi, usage, bit, max,
26 + EV_ABS, ABS_MT_CONTACT_COUNT);
27 + return 1;
28 case HID_DG_INRANGE:
29 /* touchscreen emulation */
30 hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH);
31 @@ -169,6 +173,10 @@ static int cando_event(struct hid_device *hid, struct hid_field *field,
32 struct input_dev *input = field->hidinput->input;
33
34 switch (usage->hid) {
35 + case HID_DG_CONTACTCOUNT:
36 + input_event(input,EV_ABS,ABS_MT_CONTACT_COUNT,value);
37 + //input_mt_sync(input);
38 + break;
39 case HID_DG_INRANGE:
40 td->valid = value;
41 break;
42 diff --git a/drivers/hid/hid-stantum.c b/drivers/hid/hid-stantum.c
43 index bb4430f..ac3df05 100644
44 --- a/drivers/hid/hid-stantum.c
45 +++ b/drivers/hid/hid-stantum.c
46 @@ -64,10 +64,15 @@ static int stantum_input_mapping(struct hid_device *hdev, struct hid_input *hi,
47 case HID_DG_CONFIDENCE:
48 case HID_DG_INPUTMODE:
49 case HID_DG_DEVICEINDEX:
50 - case HID_DG_CONTACTCOUNT:
51 + //case HID_DG_CONTACTCOUNT:
52 case HID_DG_CONTACTMAX:
53 return -1;
54
55 + case HID_DG_CONTACTCOUNT:
56 + hid_map_usage(hi, usage, bit, max,
57 + EV_ABS, ABS_MT_CONTACT_COUNT);
58 + return 1;
59 +
60 case HID_DG_TIPSWITCH:
61 /* touchscreen emulation */
62 hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH);
63 @@ -171,6 +176,10 @@ static int stantum_event(struct hid_device *hid, struct hid_field *field,
64 struct input_dev *input = field->hidinput->input;
65
66 switch (usage->hid) {
67 + case HID_DG_CONTACTCOUNT:
68 + input_event(input,EV_ABS,ABS_MT_CONTACT_COUNT,value);
69 + //input_mt_sync(input);
70 + break;
71 case HID_DG_INRANGE:
72 /* this is the last field in a finger */
73 stantum_filter_event(sd, input);
74 --
75 1.6.2.2
76