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
6 Enable hid-dg-contact count in stantum and cando touch drivers to be able to use with mtdev driver
10 Signed-off-by: Priya Vijayan <priya.vijayan@intel.com>
12 drivers/hid/hid-cando.c | 8 ++++++++
13 drivers/hid/hid-stantum.c | 11 ++++++++++-
14 2 files changed, 18 insertions(+), 1 deletions(-)
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:
24 + case HID_DG_CONTACTCOUNT:
25 + hid_map_usage(hi, usage, bit, max,
26 + EV_ABS, ABS_MT_CONTACT_COUNT);
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;
35 + case HID_DG_CONTACTCOUNT:
36 + input_event(input,EV_ABS,ABS_MT_CONTACT_COUNT,value);
37 + //input_mt_sync(input);
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:
55 + case HID_DG_CONTACTCOUNT:
56 + hid_map_usage(hi, usage, bit, max,
57 + EV_ABS, ABS_MT_CONTACT_COUNT);
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;
67 + case HID_DG_CONTACTCOUNT:
68 + input_event(input,EV_ABS,ABS_MT_CONTACT_COUNT,value);
69 + //input_mt_sync(input);
72 /* this is the last field in a finger */
73 stantum_filter_event(sd, input);