diff options
author | Henrik Rydberg <rydberg@euromail.se> | 2012-09-07 13:37:40 -0400 |
---|---|---|
committer | Henrik Rydberg <rydberg@euromail.se> | 2012-09-19 13:50:21 -0400 |
commit | 77723e3bc71a221a732a21700975c066a4ae06e2 (patch) | |
tree | 870b5b280370781176fae30d12a8d0f2b7d56563 /drivers/hid | |
parent | c5d40be5f5255c156a5ad851f395fb21bc44f379 (diff) |
HID: hid-multitouch: Add Flatfrog support
Add support for the Flatfrog Multitouch 3200 panel. This panel
advertises some fields that it does not use, hence the new quirk.
Cc: Pablo Cases <pablo.cases@flatfrog.com>
Acked-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/hid-ids.h | 3 | ||||
-rw-r--r-- | drivers/hid/hid-multitouch.c | 26 |
2 files changed, 24 insertions, 5 deletions
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 1dcb76ff51e3..c843db9e283f 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -283,6 +283,9 @@ | |||
283 | #define USB_VENDOR_ID_EMS 0x2006 | 283 | #define USB_VENDOR_ID_EMS 0x2006 |
284 | #define USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II 0x0118 | 284 | #define USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II 0x0118 |
285 | 285 | ||
286 | #define USB_VENDOR_ID_FLATFROG 0x25b5 | ||
287 | #define USB_DEVICE_ID_MULTITOUCH_3200 0x0002 | ||
288 | |||
286 | #define USB_VENDOR_ID_ESSENTIAL_REALITY 0x0d7f | 289 | #define USB_VENDOR_ID_ESSENTIAL_REALITY 0x0d7f |
287 | #define USB_DEVICE_ID_ESSENTIAL_REALITY_P5 0x0100 | 290 | #define USB_DEVICE_ID_ESSENTIAL_REALITY_P5 0x0100 |
288 | 291 | ||
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 63f120b7877a..ee0b76b398cb 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c | |||
@@ -51,6 +51,7 @@ MODULE_LICENSE("GPL"); | |||
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_SLOT_IS_CONTACTID_MINUS_ONE (1 << 8) | 53 | #define MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE (1 << 8) |
54 | #define MT_QUIRK_NO_AREA (1 << 9) | ||
54 | 55 | ||
55 | struct mt_slot { | 56 | struct mt_slot { |
56 | __s32 x, y, p, w, h; | 57 | __s32 x, y, p, w, h; |
@@ -115,6 +116,7 @@ struct mt_device { | |||
115 | #define MT_CLS_EGALAX_SERIAL 0x0104 | 116 | #define MT_CLS_EGALAX_SERIAL 0x0104 |
116 | #define MT_CLS_TOPSEED 0x0105 | 117 | #define MT_CLS_TOPSEED 0x0105 |
117 | #define MT_CLS_PANASONIC 0x0106 | 118 | #define MT_CLS_PANASONIC 0x0106 |
119 | #define MT_CLS_FLATFROG 0x0107 | ||
118 | 120 | ||
119 | #define MT_DEFAULT_MAXCONTACT 10 | 121 | #define MT_DEFAULT_MAXCONTACT 10 |
120 | 122 | ||
@@ -199,6 +201,12 @@ static struct mt_class mt_classes[] = { | |||
199 | .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP, | 201 | .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP, |
200 | .maxcontacts = 4 }, | 202 | .maxcontacts = 4 }, |
201 | 203 | ||
204 | { .name = MT_CLS_FLATFROG, | ||
205 | .quirks = MT_QUIRK_NOT_SEEN_MEANS_UP | | ||
206 | MT_QUIRK_NO_AREA, | ||
207 | .sn_move = 2048, | ||
208 | .maxcontacts = 40, | ||
209 | }, | ||
202 | { } | 210 | { } |
203 | }; | 211 | }; |
204 | 212 | ||
@@ -366,18 +374,21 @@ static int mt_input_mapping(struct hid_device *hdev, struct hid_input *hi, | |||
366 | case HID_DG_WIDTH: | 374 | case HID_DG_WIDTH: |
367 | hid_map_usage(hi, usage, bit, max, | 375 | hid_map_usage(hi, usage, bit, max, |
368 | EV_ABS, ABS_MT_TOUCH_MAJOR); | 376 | EV_ABS, ABS_MT_TOUCH_MAJOR); |
369 | set_abs(hi->input, ABS_MT_TOUCH_MAJOR, field, | 377 | if (!(cls->quirks & MT_QUIRK_NO_AREA)) |
370 | cls->sn_width); | 378 | set_abs(hi->input, ABS_MT_TOUCH_MAJOR, field, |
379 | cls->sn_width); | ||
371 | mt_store_field(usage, td, hi); | 380 | mt_store_field(usage, td, hi); |
372 | td->last_field_index = field->index; | 381 | td->last_field_index = field->index; |
373 | return 1; | 382 | return 1; |
374 | case HID_DG_HEIGHT: | 383 | case HID_DG_HEIGHT: |
375 | hid_map_usage(hi, usage, bit, max, | 384 | hid_map_usage(hi, usage, bit, max, |
376 | EV_ABS, ABS_MT_TOUCH_MINOR); | 385 | EV_ABS, ABS_MT_TOUCH_MINOR); |
377 | set_abs(hi->input, ABS_MT_TOUCH_MINOR, field, | 386 | if (!(cls->quirks & MT_QUIRK_NO_AREA)) { |
378 | cls->sn_height); | 387 | set_abs(hi->input, ABS_MT_TOUCH_MINOR, field, |
379 | input_set_abs_params(hi->input, | 388 | cls->sn_height); |
389 | input_set_abs_params(hi->input, | ||
380 | ABS_MT_ORIENTATION, 0, 1, 0, 0); | 390 | ABS_MT_ORIENTATION, 0, 1, 0, 0); |
391 | } | ||
381 | mt_store_field(usage, td, hi); | 392 | mt_store_field(usage, td, hi); |
382 | td->last_field_index = field->index; | 393 | td->last_field_index = field->index; |
383 | return 1; | 394 | return 1; |
@@ -860,6 +871,11 @@ static const struct hid_device_id mt_devices[] = { | |||
860 | MT_USB_DEVICE(USB_VENDOR_ID_ELO, | 871 | MT_USB_DEVICE(USB_VENDOR_ID_ELO, |
861 | USB_DEVICE_ID_ELO_TS2515) }, | 872 | USB_DEVICE_ID_ELO_TS2515) }, |
862 | 873 | ||
874 | /* Flatfrog Panels */ | ||
875 | { .driver_data = MT_CLS_FLATFROG, | ||
876 | MT_USB_DEVICE(USB_VENDOR_ID_FLATFROG, | ||
877 | USB_DEVICE_ID_MULTITOUCH_3200) }, | ||
878 | |||
863 | /* GeneralTouch panel */ | 879 | /* GeneralTouch panel */ |
864 | { .driver_data = MT_CLS_DUAL_INRANGE_CONTACTNUMBER, | 880 | { .driver_data = MT_CLS_DUAL_INRANGE_CONTACTNUMBER, |
865 | MT_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, | 881 | MT_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, |