2 * HID driver for multitouch panels
4 * Copyright (c) 2010-2011 Stephane Chatty <chatty@enac.fr>
5 * Copyright (c) 2010-2011 Benjamin Tissoires <benjamin.tissoires@gmail.com>
6 * Copyright (c) 2010-2011 Ecole Nationale de l'Aviation Civile, France
8 * This code is partly based on hid-egalax.c:
10 * Copyright (c) 2010 Stephane Chatty <chatty@enac.fr>
11 * Copyright (c) 2010 Henrik Rydberg <rydberg@euromail.se>
12 * Copyright (c) 2010 Canonical, Ltd.
14 * This code is partly based on hid-3m-pct.c:
16 * Copyright (c) 2009-2010 Stephane Chatty <chatty@enac.fr>
17 * Copyright (c) 2010 Henrik Rydberg <rydberg@euromail.se>
18 * Copyright (c) 2010 Canonical, Ltd.
23 * This program is free software; you can redistribute it and/or modify it
24 * under the terms of the GNU General Public License as published by the Free
25 * Software Foundation; either version 2 of the License, or (at your option)
29 #include <linux/device.h>
30 #include <linux/hid.h>
31 #include <linux/module.h>
32 #include <linux/slab.h>
33 #include <linux/usb.h>
34 #include <linux/input/mt.h>
35 #include "usbhid/usbhid.h"
38 MODULE_AUTHOR("Stephane Chatty <chatty@enac.fr>");
39 MODULE_AUTHOR("Benjamin Tissoires <benjamin.tissoires@gmail.com>");
40 MODULE_DESCRIPTION("HID multitouch panels");
41 MODULE_LICENSE("GPL");
45 /* quirks to control the device */
46 #define MT_QUIRK_NOT_SEEN_MEANS_UP (1 << 0)
47 #define MT_QUIRK_SLOT_IS_CONTACTID (1 << 1)
48 #define MT_QUIRK_CYPRESS (1 << 2)
49 #define MT_QUIRK_SLOT_IS_CONTACTNUMBER (1 << 3)
50 #define MT_QUIRK_VALID_IS_INRANGE (1 << 4)
51 #define MT_QUIRK_VALID_IS_CONFIDENCE (1 << 5)
52 #define MT_QUIRK_EGALAX_XYZ_FIXUP (1 << 6)
53 #define MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE (1 << 7)
57 __s32 contactid
; /* the device ContactID assigned to this slot */
58 bool touch_state
; /* is the touch valid? */
59 bool seen_in_this_frame
;/* has this slot been updated */
63 struct mt_slot curdata
; /* placeholder of incoming data */
64 struct mt_class
*mtclass
; /* our mt device class */
65 unsigned last_field_index
; /* last field index of the report */
66 unsigned last_slot_field
; /* the last field of a slot */
67 __s8 inputmode
; /* InputMode HID feature, -1 if non-existent */
68 __u8 num_received
; /* how many contacts we received */
69 __u8 num_expected
; /* expected last contact index */
71 bool curvalid
; /* is the current contact valid? */
72 struct mt_slot
*slots
;
76 __s32 name
; /* MT_CLS */
78 __s32 sn_move
; /* Signal/noise ratio for move events */
79 __s32 sn_width
; /* Signal/noise ratio for width events */
80 __s32 sn_height
; /* Signal/noise ratio for height events */
81 __s32 sn_pressure
; /* Signal/noise ratio for pressure events */
85 /* classes of device behavior */
86 #define MT_CLS_DEFAULT 1
87 #define MT_CLS_DUAL_INRANGE_CONTACTID 2
88 #define MT_CLS_DUAL_INRANGE_CONTACTNUMBER 3
89 #define MT_CLS_CYPRESS 4
90 #define MT_CLS_EGALAX 5
91 #define MT_CLS_STANTUM 6
93 #define MT_CLS_CONFIDENCE 8
94 #define MT_CLS_CONFIDENCE_MINUS_ONE 9
96 #define MT_DEFAULT_MAXCONTACT 10
99 * these device-dependent functions determine what slot corresponds
100 * to a valid contact that was just read.
103 static int cypress_compute_slot(struct mt_device
*td
)
105 if (td
->curdata
.contactid
!= 0 || td
->num_received
== 0)
106 return td
->curdata
.contactid
;
111 static int find_slot_from_contactid(struct mt_device
*td
)
114 for (i
= 0; i
< td
->maxcontacts
; ++i
) {
115 if (td
->slots
[i
].contactid
== td
->curdata
.contactid
&&
116 td
->slots
[i
].touch_state
)
119 for (i
= 0; i
< td
->maxcontacts
; ++i
) {
120 if (!td
->slots
[i
].seen_in_this_frame
&&
121 !td
->slots
[i
].touch_state
)
124 /* should not occurs. If this happens that means
125 * that the device sent more touches that it says
126 * in the report descriptor. It is ignored then. */
130 struct mt_class mt_classes
[] = {
131 { .name
= MT_CLS_DEFAULT
,
132 .quirks
= MT_QUIRK_NOT_SEEN_MEANS_UP
},
133 { .name
= MT_CLS_DUAL_INRANGE_CONTACTID
,
134 .quirks
= MT_QUIRK_VALID_IS_INRANGE
|
135 MT_QUIRK_SLOT_IS_CONTACTID
,
137 { .name
= MT_CLS_DUAL_INRANGE_CONTACTNUMBER
,
138 .quirks
= MT_QUIRK_VALID_IS_INRANGE
|
139 MT_QUIRK_SLOT_IS_CONTACTNUMBER
,
141 { .name
= MT_CLS_CYPRESS
,
142 .quirks
= MT_QUIRK_NOT_SEEN_MEANS_UP
|
145 { .name
= MT_CLS_CONFIDENCE_MINUS_ONE
,
146 .quirks
= MT_QUIRK_VALID_IS_CONFIDENCE
|
147 MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE
},
148 { .name
= MT_CLS_EGALAX
,
149 .quirks
= MT_QUIRK_SLOT_IS_CONTACTID
|
150 MT_QUIRK_VALID_IS_INRANGE
|
151 MT_QUIRK_EGALAX_XYZ_FIXUP
,
156 { .name
= MT_CLS_STANTUM
,
157 .quirks
= MT_QUIRK_VALID_IS_CONFIDENCE
},
159 .quirks
= MT_QUIRK_VALID_IS_CONFIDENCE
|
160 MT_QUIRK_SLOT_IS_CONTACTID
,
164 { .name
= MT_CLS_CONFIDENCE
,
165 .quirks
= MT_QUIRK_VALID_IS_CONFIDENCE
},
170 static void mt_feature_mapping(struct hid_device
*hdev
,
171 struct hid_field
*field
, struct hid_usage
*usage
)
173 struct mt_device
*td
= hid_get_drvdata(hdev
);
175 switch (usage
->hid
) {
176 case HID_DG_INPUTMODE
:
177 td
->inputmode
= field
->report
->id
;
179 case HID_DG_CONTACTMAX
:
180 td
->maxcontacts
= field
->value
[0];
181 if (td
->mtclass
->maxcontacts
)
182 /* check if the maxcontacts is given by the class */
183 td
->maxcontacts
= td
->mtclass
->maxcontacts
;
189 static void set_abs(struct input_dev
*input
, unsigned int code
,
190 struct hid_field
*field
, int snratio
)
192 int fmin
= field
->logical_minimum
;
193 int fmax
= field
->logical_maximum
;
194 int fuzz
= snratio
? (fmax
- fmin
) / snratio
: 0;
195 input_set_abs_params(input
, code
, fmin
, fmax
, fuzz
, 0);
198 static int mt_input_mapping(struct hid_device
*hdev
, struct hid_input
*hi
,
199 struct hid_field
*field
, struct hid_usage
*usage
,
200 unsigned long **bit
, int *max
)
202 struct mt_device
*td
= hid_get_drvdata(hdev
);
203 struct mt_class
*cls
= td
->mtclass
;
204 __s32 quirks
= cls
->quirks
;
206 switch (usage
->hid
& HID_USAGE_PAGE
) {
209 switch (usage
->hid
) {
211 if (quirks
& MT_QUIRK_EGALAX_XYZ_FIXUP
)
212 field
->logical_maximum
= 32760;
213 hid_map_usage(hi
, usage
, bit
, max
,
214 EV_ABS
, ABS_MT_POSITION_X
);
215 set_abs(hi
->input
, ABS_MT_POSITION_X
, field
,
217 /* touchscreen emulation */
218 set_abs(hi
->input
, ABS_X
, field
, cls
->sn_move
);
219 td
->last_slot_field
= usage
->hid
;
220 td
->last_field_index
= field
->index
;
223 if (quirks
& MT_QUIRK_EGALAX_XYZ_FIXUP
)
224 field
->logical_maximum
= 32760;
225 hid_map_usage(hi
, usage
, bit
, max
,
226 EV_ABS
, ABS_MT_POSITION_Y
);
227 set_abs(hi
->input
, ABS_MT_POSITION_Y
, field
,
229 /* touchscreen emulation */
230 set_abs(hi
->input
, ABS_Y
, field
, cls
->sn_move
);
231 td
->last_slot_field
= usage
->hid
;
232 td
->last_field_index
= field
->index
;
237 case HID_UP_DIGITIZER
:
238 switch (usage
->hid
) {
240 td
->last_slot_field
= usage
->hid
;
241 td
->last_field_index
= field
->index
;
243 case HID_DG_CONFIDENCE
:
244 td
->last_slot_field
= usage
->hid
;
245 td
->last_field_index
= field
->index
;
247 case HID_DG_TIPSWITCH
:
248 hid_map_usage(hi
, usage
, bit
, max
, EV_KEY
, BTN_TOUCH
);
249 input_set_capability(hi
->input
, EV_KEY
, BTN_TOUCH
);
250 td
->last_slot_field
= usage
->hid
;
251 td
->last_field_index
= field
->index
;
253 case HID_DG_CONTACTID
:
254 input_mt_init_slots(hi
->input
, td
->maxcontacts
);
255 td
->last_slot_field
= usage
->hid
;
256 td
->last_field_index
= field
->index
;
259 hid_map_usage(hi
, usage
, bit
, max
,
260 EV_ABS
, ABS_MT_TOUCH_MAJOR
);
261 set_abs(hi
->input
, ABS_MT_TOUCH_MAJOR
, field
,
263 td
->last_slot_field
= usage
->hid
;
264 td
->last_field_index
= field
->index
;
267 hid_map_usage(hi
, usage
, bit
, max
,
268 EV_ABS
, ABS_MT_TOUCH_MINOR
);
269 set_abs(hi
->input
, ABS_MT_TOUCH_MINOR
, field
,
271 input_set_abs_params(hi
->input
,
272 ABS_MT_ORIENTATION
, 0, 1, 0, 0);
273 td
->last_slot_field
= usage
->hid
;
274 td
->last_field_index
= field
->index
;
276 case HID_DG_TIPPRESSURE
:
277 if (quirks
& MT_QUIRK_EGALAX_XYZ_FIXUP
)
278 field
->logical_minimum
= 0;
279 hid_map_usage(hi
, usage
, bit
, max
,
280 EV_ABS
, ABS_MT_PRESSURE
);
281 set_abs(hi
->input
, ABS_MT_PRESSURE
, field
,
283 /* touchscreen emulation */
284 set_abs(hi
->input
, ABS_PRESSURE
, field
,
286 td
->last_slot_field
= usage
->hid
;
287 td
->last_field_index
= field
->index
;
289 case HID_DG_CONTACTCOUNT
:
290 td
->last_field_index
= field
->index
;
292 case HID_DG_CONTACTMAX
:
293 /* we don't set td->last_slot_field as contactcount and
294 * contact max are global to the report */
295 td
->last_field_index
= field
->index
;
298 /* let hid-input decide for the others */
302 /* we do not want to map these: no input-oriented meaning */
309 static int mt_input_mapped(struct hid_device
*hdev
, struct hid_input
*hi
,
310 struct hid_field
*field
, struct hid_usage
*usage
,
311 unsigned long **bit
, int *max
)
313 if (usage
->type
== EV_KEY
|| usage
->type
== EV_ABS
)
314 set_bit(usage
->type
, hi
->input
->evbit
);
319 static int mt_compute_slot(struct mt_device
*td
)
321 __s32 quirks
= td
->mtclass
->quirks
;
323 if (quirks
& MT_QUIRK_SLOT_IS_CONTACTID
)
324 return td
->curdata
.contactid
;
326 if (quirks
& MT_QUIRK_CYPRESS
)
327 return cypress_compute_slot(td
);
329 if (quirks
& MT_QUIRK_SLOT_IS_CONTACTNUMBER
)
330 return td
->num_received
;
332 if (quirks
& MT_QUIRK_SLOT_IS_CONTACTID_MINUS_ONE
)
333 return td
->curdata
.contactid
- 1;
335 return find_slot_from_contactid(td
);
339 * this function is called when a whole contact has been processed,
340 * so that it can assign it to a slot and store the data there
342 static void mt_complete_slot(struct mt_device
*td
)
344 td
->curdata
.seen_in_this_frame
= true;
346 int slotnum
= mt_compute_slot(td
);
348 if (slotnum
>= 0 && slotnum
< td
->maxcontacts
)
349 td
->slots
[slotnum
] = td
->curdata
;
356 * this function is called when a whole packet has been received and processed,
357 * so that it can decide what to send to the input layer.
359 static void mt_emit_event(struct mt_device
*td
, struct input_dev
*input
)
363 for (i
= 0; i
< td
->maxcontacts
; ++i
) {
364 struct mt_slot
*s
= &(td
->slots
[i
]);
365 if ((td
->mtclass
->quirks
& MT_QUIRK_NOT_SEEN_MEANS_UP
) &&
366 !s
->seen_in_this_frame
) {
367 s
->touch_state
= false;
370 input_mt_slot(input
, i
);
371 input_mt_report_slot_state(input
, MT_TOOL_FINGER
,
373 if (s
->touch_state
) {
374 /* this finger is on the screen */
375 int wide
= (s
->w
> s
->h
);
376 /* divided by two to match visual scale of touch */
377 int major
= max(s
->w
, s
->h
) >> 1;
378 int minor
= min(s
->w
, s
->h
) >> 1;
380 input_event(input
, EV_ABS
, ABS_MT_POSITION_X
, s
->x
);
381 input_event(input
, EV_ABS
, ABS_MT_POSITION_Y
, s
->y
);
382 input_event(input
, EV_ABS
, ABS_MT_ORIENTATION
, wide
);
383 input_event(input
, EV_ABS
, ABS_MT_PRESSURE
, s
->p
);
384 input_event(input
, EV_ABS
, ABS_MT_TOUCH_MAJOR
, major
);
385 input_event(input
, EV_ABS
, ABS_MT_TOUCH_MINOR
, minor
);
387 s
->seen_in_this_frame
= false;
391 input_mt_report_pointer_emulation(input
, true);
393 td
->num_received
= 0;
398 static int mt_event(struct hid_device
*hid
, struct hid_field
*field
,
399 struct hid_usage
*usage
, __s32 value
)
401 struct mt_device
*td
= hid_get_drvdata(hid
);
402 __s32 quirks
= td
->mtclass
->quirks
;
404 if (hid
->claimed
& HID_CLAIMED_INPUT
&& td
->slots
) {
405 switch (usage
->hid
) {
407 if (quirks
& MT_QUIRK_VALID_IS_INRANGE
)
408 td
->curvalid
= value
;
410 case HID_DG_TIPSWITCH
:
411 if (quirks
& MT_QUIRK_NOT_SEEN_MEANS_UP
)
412 td
->curvalid
= value
;
413 td
->curdata
.touch_state
= value
;
415 case HID_DG_CONFIDENCE
:
416 if (quirks
& MT_QUIRK_VALID_IS_CONFIDENCE
)
417 td
->curvalid
= value
;
419 case HID_DG_CONTACTID
:
420 td
->curdata
.contactid
= value
;
422 case HID_DG_TIPPRESSURE
:
423 td
->curdata
.p
= value
;
426 td
->curdata
.x
= value
;
429 td
->curdata
.y
= value
;
432 td
->curdata
.w
= value
;
435 td
->curdata
.h
= value
;
437 case HID_DG_CONTACTCOUNT
:
439 * Includes multi-packet support where subsequent
440 * packets are sent with zero contactcount.
443 td
->num_expected
= value
;
447 /* fallback to the generic hidinput handling */
451 if (usage
->hid
== td
->last_slot_field
) {
452 mt_complete_slot(td
);
455 if (field
->index
== td
->last_field_index
456 && td
->num_received
>= td
->num_expected
)
457 mt_emit_event(td
, field
->hidinput
->input
);
461 /* we have handled the hidinput part, now remains hiddev */
462 if (hid
->claimed
& HID_CLAIMED_HIDDEV
&& hid
->hiddev_hid_event
)
463 hid
->hiddev_hid_event(hid
, field
, usage
, value
);
468 static void mt_set_input_mode(struct hid_device
*hdev
)
470 struct mt_device
*td
= hid_get_drvdata(hdev
);
471 struct hid_report
*r
;
472 struct hid_report_enum
*re
;
474 if (td
->inputmode
< 0)
477 re
= &(hdev
->report_enum
[HID_FEATURE_REPORT
]);
478 r
= re
->report_id_hash
[td
->inputmode
];
480 r
->field
[0]->value
[0] = 0x02;
481 usbhid_submit_report(hdev
, r
, USB_DIR_OUT
);
485 static int mt_probe(struct hid_device
*hdev
, const struct hid_device_id
*id
)
488 struct mt_device
*td
;
489 struct mt_class
*mtclass
= mt_classes
; /* MT_CLS_DEFAULT */
491 for (i
= 0; mt_classes
[i
].name
; i
++) {
492 if (id
->driver_data
== mt_classes
[i
].name
) {
493 mtclass
= &(mt_classes
[i
]);
498 /* This allows the driver to correctly support devices
499 * that emit events over several HID messages.
501 hdev
->quirks
|= HID_QUIRK_NO_INPUT_SYNC
;
503 td
= kzalloc(sizeof(struct mt_device
), GFP_KERNEL
);
505 dev_err(&hdev
->dev
, "cannot allocate multitouch data\n");
508 td
->mtclass
= mtclass
;
510 hid_set_drvdata(hdev
, td
);
512 ret
= hid_parse(hdev
);
516 ret
= hid_hw_start(hdev
, HID_CONNECT_DEFAULT
);
520 if (!td
->maxcontacts
)
521 td
->maxcontacts
= MT_DEFAULT_MAXCONTACT
;
523 td
->slots
= kzalloc(td
->maxcontacts
* sizeof(struct mt_slot
),
526 dev_err(&hdev
->dev
, "cannot allocate multitouch slots\n");
532 mt_set_input_mode(hdev
);
542 static int mt_reset_resume(struct hid_device
*hdev
)
544 mt_set_input_mode(hdev
);
549 static void mt_remove(struct hid_device
*hdev
)
551 struct mt_device
*td
= hid_get_drvdata(hdev
);
555 hid_set_drvdata(hdev
, NULL
);
558 static const struct hid_device_id mt_devices
[] = {
561 { .driver_data
= MT_CLS_3M
,
562 HID_USB_DEVICE(USB_VENDOR_ID_3M
,
563 USB_DEVICE_ID_3M1968
) },
564 { .driver_data
= MT_CLS_3M
,
565 HID_USB_DEVICE(USB_VENDOR_ID_3M
,
566 USB_DEVICE_ID_3M2256
) },
569 { .driver_data
= MT_CLS_DUAL_INRANGE_CONTACTNUMBER
,
570 HID_USB_DEVICE(USB_VENDOR_ID_CANDO
,
571 USB_DEVICE_ID_CANDO_MULTI_TOUCH
) },
572 { .driver_data
= MT_CLS_DUAL_INRANGE_CONTACTNUMBER
,
573 HID_USB_DEVICE(USB_VENDOR_ID_CANDO
,
574 USB_DEVICE_ID_CANDO_MULTI_TOUCH_10_1
) },
575 { .driver_data
= MT_CLS_DUAL_INRANGE_CONTACTNUMBER
,
576 HID_USB_DEVICE(USB_VENDOR_ID_CANDO
,
577 USB_DEVICE_ID_CANDO_MULTI_TOUCH_11_6
) },
578 { .driver_data
= MT_CLS_DUAL_INRANGE_CONTACTNUMBER
,
579 HID_USB_DEVICE(USB_VENDOR_ID_CANDO
,
580 USB_DEVICE_ID_CANDO_MULTI_TOUCH_15_6
) },
583 { .driver_data
= MT_CLS_CYPRESS
,
584 HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS
,
585 USB_DEVICE_ID_CYPRESS_TRUETOUCH
) },
587 /* GeneralTouch panel */
588 { .driver_data
= MT_CLS_DUAL_INRANGE_CONTACTNUMBER
,
589 HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH
,
590 USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS
) },
592 /* Ilitek dual touch panel */
593 { .driver_data
= MT_CLS_DEFAULT
,
594 HID_USB_DEVICE(USB_VENDOR_ID_ILITEK
,
595 USB_DEVICE_ID_ILITEK_MULTITOUCH
) },
598 { .driver_data
= MT_CLS_DUAL_INRANGE_CONTACTID
,
599 HID_USB_DEVICE(USB_VENDOR_ID_IRTOUCHSYSTEMS
,
600 USB_DEVICE_ID_IRTOUCH_INFRARED_USB
) },
603 { .driver_data
= MT_CLS_CONFIDENCE_MINUS_ONE
,
604 HID_USB_DEVICE(USB_VENDOR_ID_LUMIO
,
605 USB_DEVICE_ID_CRYSTALTOUCH
) },
608 { .driver_data
= MT_CLS_CONFIDENCE_MINUS_ONE
,
609 HID_USB_DEVICE(USB_VENDOR_ID_ASUS
,
610 USB_DEVICE_ID_ASUS_T91MT
)},
611 { .driver_data
= MT_CLS_CONFIDENCE_MINUS_ONE
,
612 HID_USB_DEVICE(USB_VENDOR_ID_ASUS
,
613 USB_DEVICE_ID_ASUSTEK_MULTITOUCH_YFO
) },
614 { .driver_data
= MT_CLS_CONFIDENCE_MINUS_ONE
,
615 HID_USB_DEVICE(USB_VENDOR_ID_TURBOX
,
616 USB_DEVICE_ID_TURBOX_TOUCHSCREEN_MOSART
) },
618 /* PenMount panels */
619 { .driver_data
= MT_CLS_CONFIDENCE
,
620 HID_USB_DEVICE(USB_VENDOR_ID_PENMOUNT
,
621 USB_DEVICE_ID_PENMOUNT_PCI
) },
623 /* PixCir-based panels */
624 { .driver_data
= MT_CLS_DUAL_INRANGE_CONTACTID
,
625 HID_USB_DEVICE(USB_VENDOR_ID_HANVON
,
626 USB_DEVICE_ID_HANVON_MULTITOUCH
) },
627 { .driver_data
= MT_CLS_DUAL_INRANGE_CONTACTID
,
628 HID_USB_DEVICE(USB_VENDOR_ID_CANDO
,
629 USB_DEVICE_ID_CANDO_PIXCIR_MULTI_TOUCH
) },
631 /* Resistive eGalax devices */
632 { .driver_data
= MT_CLS_EGALAX
,
633 HID_USB_DEVICE(USB_VENDOR_ID_DWAV
,
634 USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH
) },
635 { .driver_data
= MT_CLS_EGALAX
,
636 HID_USB_DEVICE(USB_VENDOR_ID_DWAV
,
637 USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH3
) },
639 /* Capacitive eGalax devices */
640 { .driver_data
= MT_CLS_EGALAX
,
641 HID_USB_DEVICE(USB_VENDOR_ID_DWAV
,
642 USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH1
) },
643 { .driver_data
= MT_CLS_EGALAX
,
644 HID_USB_DEVICE(USB_VENDOR_ID_DWAV
,
645 USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH2
) },
646 { .driver_data
= MT_CLS_EGALAX
,
647 HID_USB_DEVICE(USB_VENDOR_ID_DWAV
,
648 USB_DEVICE_ID_DWAV_EGALAX_MULTITOUCH4
) },
651 { .driver_data
= MT_CLS_STANTUM
,
652 HID_USB_DEVICE(USB_VENDOR_ID_STANTUM
,
654 { .driver_data
= MT_CLS_STANTUM
,
655 HID_USB_DEVICE(USB_VENDOR_ID_STANTUM
,
656 USB_DEVICE_ID_MTP_STM
)},
657 { .driver_data
= MT_CLS_STANTUM
,
658 HID_USB_DEVICE(USB_VENDOR_ID_STANTUM
,
659 USB_DEVICE_ID_MTP_SITRONIX
)},
663 MODULE_DEVICE_TABLE(hid
, mt_devices
);
665 static const struct hid_usage_id mt_grabbed_usages
[] = {
666 { HID_ANY_ID
, HID_ANY_ID
, HID_ANY_ID
},
667 { HID_ANY_ID
- 1, HID_ANY_ID
- 1, HID_ANY_ID
- 1}
670 static struct hid_driver mt_driver
= {
671 .name
= "hid-multitouch",
672 .id_table
= mt_devices
,
675 .input_mapping
= mt_input_mapping
,
676 .input_mapped
= mt_input_mapped
,
677 .feature_mapping
= mt_feature_mapping
,
678 .usage_table
= mt_grabbed_usages
,
681 .reset_resume
= mt_reset_resume
,
685 static int __init
mt_init(void)
687 return hid_register_driver(&mt_driver
);
690 static void __exit
mt_exit(void)
692 hid_unregister_driver(&mt_driver
);
695 module_init(mt_init
);
696 module_exit(mt_exit
);