@@ -68,6 +68,7 @@ MODULE_LICENSE("GPL");
6868#define MT_QUIRK_STICKY_FINGERS BIT(16)
6969#define MT_QUIRK_ASUS_CUSTOM_UP BIT(17)
7070#define MT_QUIRK_WIN8_PTP_BUTTONS BIT(18)
71+ #define MT_QUIRK_SEPARATE_APP_REPORT BIT(19)
7172
7273#define MT_INPUTMODE_TOUCHSCREEN 0x02
7374#define MT_INPUTMODE_TOUCHPAD 0x03
@@ -103,6 +104,7 @@ struct mt_usages {
103104struct mt_application {
104105 struct list_head list ;
105106 unsigned int application ;
107+ unsigned int report_id ;
106108 struct list_head mt_usages ; /* mt usages list */
107109
108110 __s32 quirks ;
@@ -203,6 +205,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app);
203205#define MT_CLS_VTL 0x0110
204206#define MT_CLS_GOOGLE 0x0111
205207#define MT_CLS_RAZER_BLADE_STEALTH 0x0112
208+ #define MT_CLS_SMART_TECH 0x0113
206209
207210#define MT_DEFAULT_MAXCONTACT 10
208211#define MT_MAX_MAXCONTACT 250
@@ -263,7 +266,8 @@ static const struct mt_class mt_classes[] = {
263266 MT_QUIRK_HOVERING |
264267 MT_QUIRK_CONTACT_CNT_ACCURATE |
265268 MT_QUIRK_STICKY_FINGERS |
266- MT_QUIRK_WIN8_PTP_BUTTONS },
269+ MT_QUIRK_WIN8_PTP_BUTTONS ,
270+ .export_all_inputs = true },
267271 { .name = MT_CLS_EXPORT_ALL_INPUTS ,
268272 .quirks = MT_QUIRK_ALWAYS_VALID |
269273 MT_QUIRK_CONTACT_CNT_ACCURATE ,
@@ -353,6 +357,12 @@ static const struct mt_class mt_classes[] = {
353357 MT_QUIRK_CONTACT_CNT_ACCURATE |
354358 MT_QUIRK_WIN8_PTP_BUTTONS ,
355359 },
360+ { .name = MT_CLS_SMART_TECH ,
361+ .quirks = MT_QUIRK_ALWAYS_VALID |
362+ MT_QUIRK_IGNORE_DUPLICATES |
363+ MT_QUIRK_CONTACT_CNT_ACCURATE |
364+ MT_QUIRK_SEPARATE_APP_REPORT ,
365+ },
356366 { }
357367};
358368
@@ -509,8 +519,9 @@ static struct mt_usages *mt_allocate_usage(struct hid_device *hdev,
509519}
510520
511521static struct mt_application * mt_allocate_application (struct mt_device * td ,
512- unsigned int application )
522+ struct hid_report * report )
513523{
524+ unsigned int application = report -> application ;
514525 struct mt_application * mt_application ;
515526
516527 mt_application = devm_kzalloc (& td -> hdev -> dev , sizeof (* mt_application ),
@@ -535,26 +546,31 @@ static struct mt_application *mt_allocate_application(struct mt_device *td,
535546 mt_application -> scantime = DEFAULT_ZERO ;
536547 mt_application -> raw_cc = DEFAULT_ZERO ;
537548 mt_application -> quirks = td -> mtclass .quirks ;
549+ mt_application -> report_id = report -> id ;
538550
539551 list_add_tail (& mt_application -> list , & td -> applications );
540552
541553 return mt_application ;
542554}
543555
544556static struct mt_application * mt_find_application (struct mt_device * td ,
545- unsigned int application )
557+ struct hid_report * report )
546558{
559+ unsigned int application = report -> application ;
547560 struct mt_application * tmp , * mt_application = NULL ;
548561
549562 list_for_each_entry (tmp , & td -> applications , list ) {
550563 if (application == tmp -> application ) {
551- mt_application = tmp ;
552- break ;
564+ if (!(td -> mtclass .quirks & MT_QUIRK_SEPARATE_APP_REPORT ) ||
565+ tmp -> report_id == report -> id ) {
566+ mt_application = tmp ;
567+ break ;
568+ }
553569 }
554570 }
555571
556572 if (!mt_application )
557- mt_application = mt_allocate_application (td , application );
573+ mt_application = mt_allocate_application (td , report );
558574
559575 return mt_application ;
560576}
@@ -571,7 +587,7 @@ static struct mt_report_data *mt_allocate_report_data(struct mt_device *td,
571587 return NULL ;
572588
573589 rdata -> report = report ;
574- rdata -> application = mt_find_application (td , report -> application );
590+ rdata -> application = mt_find_application (td , report );
575591
576592 if (!rdata -> application ) {
577593 devm_kfree (& td -> hdev -> dev , rdata );
@@ -1561,6 +1577,9 @@ static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
15611577 case HID_VD_ASUS_CUSTOM_MEDIA_KEYS :
15621578 suffix = "Custom Media Keys" ;
15631579 break ;
1580+ case HID_DG_PEN :
1581+ suffix = "Stylus" ;
1582+ break ;
15641583 default :
15651584 suffix = "UNKNOWN" ;
15661585 break ;
@@ -2022,6 +2041,10 @@ static const struct hid_device_id mt_devices[] = {
20222041 HID_DEVICE (BUS_I2C , HID_GROUP_MULTITOUCH_WIN_8 ,
20232042 USB_VENDOR_ID_SYNAPTICS , 0x8323 ) },
20242043
2044+ /* Smart Tech panels */
2045+ { .driver_data = MT_CLS_SMART_TECH ,
2046+ MT_USB_DEVICE (0x0b8c , 0x0092 )},
2047+
20252048 /* Stantum panels */
20262049 { .driver_data = MT_CLS_CONFIDENCE ,
20272050 MT_USB_DEVICE (USB_VENDOR_ID_STANTUM_STM ,
0 commit comments