aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@enac.fr>2011-11-23 04:54:29 -0500
committerJiri Kosina <jkosina@suse.cz>2011-11-23 08:50:38 -0500
commit2261bb9ff0dc38e1d5f35af08f75ec3b37ba6335 (patch)
tree2b3e5bc378bb16dbe66c28b32ed92f071f63fa7d /drivers/hid
parenteec29e3dab483a5d9a742a6fa68db1ec1f0f7504 (diff)
HID: multitouch: cleanup eGalax quirks
The previous implementation of eGalax protocol was not satisfying as we had to manually set x/y ranges as they were corrupted after reading the report descriptor. Indeed, the report descriptor provided a stylus input interface which override the correct values. This patch omits this input, thus leaving the correct value untouched, and the MT_QUIRK_EGALAX_XYZ_FIXUP not required anymore. Signed-off-by: Benjamin Tissoires <benjamin.tissoires@enac.fr> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-multitouch.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index a51e62efbac1..94756d28af59 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -50,7 +50,6 @@ MODULE_LICENSE("GPL");
50#define MT_QUIRK_ALWAYS_VALID (1 << 4) 50#define MT_QUIRK_ALWAYS_VALID (1 << 4)
51#define MT_QUIRK_VALID_IS_INRANGE (1 << 5) 51#define MT_QUIRK_VALID_IS_INRANGE (1 << 5)
52#define MT_QUIRK_VALID_IS_CONFIDENCE (1 << 6) 52#define MT_QUIRK_VALID_IS_CONFIDENCE (1 << 6)
53#define MT_QUIRK_EGALAX_XYZ_FIXUP (1 << 7)
54#define MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE (1 << 8) 53#define MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE (1 << 8)
55 54
56struct mt_slot { 55struct mt_slot {
@@ -171,8 +170,7 @@ struct mt_class mt_classes[] = {
171 .maxcontacts = 10 }, 170 .maxcontacts = 10 },
172 { .name = MT_CLS_EGALAX, 171 { .name = MT_CLS_EGALAX,
173 .quirks = MT_QUIRK_SLOT_IS_CONTACTID | 172 .quirks = MT_QUIRK_SLOT_IS_CONTACTID |
174 MT_QUIRK_VALID_IS_INRANGE | 173 MT_QUIRK_VALID_IS_INRANGE,
175 MT_QUIRK_EGALAX_XYZ_FIXUP,
176 .maxcontacts = 2, 174 .maxcontacts = 2,
177 .sn_move = 4096, 175 .sn_move = 4096,
178 .sn_pressure = 32, 176 .sn_pressure = 32,
@@ -253,7 +251,6 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
253{ 251{
254 struct mt_device *td = hid_get_drvdata(hdev); 252 struct mt_device *td = hid_get_drvdata(hdev);
255 struct mt_class *cls = &td->mtclass; 253 struct mt_class *cls = &td->mtclass;
256 __s32 quirks = cls->quirks;
257 254
258 /* Only map fields from TouchScreen or TouchPad collections. 255 /* Only map fields from TouchScreen or TouchPad collections.
259 * We need to ignore fields that belong to other collections 256 * We need to ignore fields that belong to other collections
@@ -265,13 +262,17 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
265 else 262 else
266 return 0; 263 return 0;
267 264
265 /* eGalax devices provide a Digitizer.Stylus input which overrides
266 * the correct Digitizers.Finger X/Y ranges.
267 * Let's just ignore this input. */
268 if (field->physical == HID_DG_STYLUS)
269 return -1;
270
268 switch (usage->hid & HID_USAGE_PAGE) { 271 switch (usage->hid & HID_USAGE_PAGE) {
269 272
270 case HID_UP_GENDESK: 273 case HID_UP_GENDESK:
271 switch (usage->hid) { 274 switch (usage->hid) {
272 case HID_GD_X: 275 case HID_GD_X:
273 if (quirks & MT_QUIRK_EGALAX_XYZ_FIXUP)
274 field->logical_maximum = 32760;
275 hid_map_usage(hi, usage, bit, max, 276 hid_map_usage(hi, usage, bit, max,
276 EV_ABS, ABS_MT_POSITION_X); 277 EV_ABS, ABS_MT_POSITION_X);
277 set_abs(hi->input, ABS_MT_POSITION_X, field, 278 set_abs(hi->input, ABS_MT_POSITION_X, field,
@@ -284,8 +285,6 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
284 } 285 }
285 return 1; 286 return 1;
286 case HID_GD_Y: 287 case HID_GD_Y:
287 if (quirks & MT_QUIRK_EGALAX_XYZ_FIXUP)
288 field->logical_maximum = 32760;
289 hid_map_usage(hi, usage, bit, max, 288 hid_map_usage(hi, usage, bit, max,
290 EV_ABS, ABS_MT_POSITION_Y); 289 EV_ABS, ABS_MT_POSITION_Y);
291 set_abs(hi->input, ABS_MT_POSITION_Y, field, 290 set_abs(hi->input, ABS_MT_POSITION_Y, field,
@@ -353,8 +352,6 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi,
353 } 352 }
354 return 1; 353 return 1;
355 case HID_DG_TIPPRESSURE: 354 case HID_DG_TIPPRESSURE:
356 if (quirks & MT_QUIRK_EGALAX_XYZ_FIXUP)
357 field->logical_minimum = 0;
358 hid_map_usage(hi, usage, bit, max, 355 hid_map_usage(hi, usage, bit, max,
359 EV_ABS, ABS_MT_PRESSURE); 356 EV_ABS, ABS_MT_PRESSURE);
360 set_abs(hi->input, ABS_MT_PRESSURE, field, 357 set_abs(hi->input, ABS_MT_PRESSURE, field,