Skip to content

Commit 504c932

Browse files
Masaki OtaJiri Kosina
authored andcommitted
HID: multitouch: Support PTP Stick and Touchpad device
Support PTP Stick and Touchpad device. This Touchpad is Precision Touchpad (PTP), and Stick Pointer data is the same as Mouse; Stick Pointer works as Mouse. [jkosina@suse.cz: changelog deuglification] Signed-off-by: Masaki Ota <masaki.ota@jp.alps.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent b45edc2 commit 504c932

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

drivers/hid/hid-ids.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@
7575

7676
#define USB_VENDOR_ID_ALPS_JP 0x044E
7777
#define HID_DEVICE_ID_ALPS_U1_DUAL 0x120B
78+
#define HID_DEVICE_ID_ALPS_U1_DUAL_PTP 0x121F
79+
#define HID_DEVICE_ID_ALPS_U1_DUAL_3BTN_PTP 0x1220
7880

7981
#define USB_VENDOR_ID_AMI 0x046b
8082
#define USB_DEVICE_ID_AMI_VIRT_KEYBOARD_AND_MOUSE 0xff10

drivers/hid/hid-multitouch.c

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ static void mt_post_parse(struct mt_device *td);
148148
/* reserved 0x0011 */
149149
#define MT_CLS_WIN_8 0x0012
150150
#define MT_CLS_EXPORT_ALL_INPUTS 0x0013
151+
#define MT_CLS_WIN_8_DUAL 0x0014
151152

152153
/* vendor specific classes */
153154
#define MT_CLS_3M 0x0101
@@ -217,6 +218,12 @@ static struct mt_class mt_classes[] = {
217218
.quirks = MT_QUIRK_ALWAYS_VALID |
218219
MT_QUIRK_CONTACT_CNT_ACCURATE,
219220
.export_all_inputs = true },
221+
{ .name = MT_CLS_WIN_8_DUAL,
222+
.quirks = MT_QUIRK_ALWAYS_VALID |
223+
MT_QUIRK_IGNORE_DUPLICATES |
224+
MT_QUIRK_HOVERING |
225+
MT_QUIRK_CONTACT_CNT_ACCURATE,
226+
.export_all_inputs = true },
220227

221228
/*
222229
* vendor specific classes
@@ -512,7 +519,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
512519
mt_store_field(usage, td, hi);
513520
return 1;
514521
case HID_DG_CONFIDENCE:
515-
if (cls->name == MT_CLS_WIN_8 &&
522+
if ((cls->name == MT_CLS_WIN_8 ||
523+
cls->name == MT_CLS_WIN_8_DUAL) &&
516524
field->application == HID_DG_TOUCHPAD)
517525
cls->quirks |= MT_QUIRK_CONFIDENCE;
518526
mt_store_field(usage, td, hi);
@@ -579,7 +587,8 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
579587
* MS PTP spec says that external buttons left and right have
580588
* usages 2 and 3.
581589
*/
582-
if (cls->name == MT_CLS_WIN_8 &&
590+
if ((cls->name == MT_CLS_WIN_8 ||
591+
cls->name == MT_CLS_WIN_8_DUAL) &&
583592
field->application == HID_DG_TOUCHPAD &&
584593
(usage->hid & HID_USAGE) > 1)
585594
code--;
@@ -1290,6 +1299,16 @@ static const struct hid_device_id mt_devices[] = {
12901299
MT_USB_DEVICE(USB_VENDOR_ID_3M,
12911300
USB_DEVICE_ID_3M3266) },
12921301

1302+
/* Alps devices */
1303+
{ .driver_data = MT_CLS_WIN_8_DUAL,
1304+
HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
1305+
USB_VENDOR_ID_ALPS_JP,
1306+
HID_DEVICE_ID_ALPS_U1_DUAL_PTP) },
1307+
{ .driver_data = MT_CLS_WIN_8_DUAL,
1308+
HID_DEVICE(BUS_I2C, HID_GROUP_MULTITOUCH_WIN_8,
1309+
USB_VENDOR_ID_ALPS_JP,
1310+
HID_DEVICE_ID_ALPS_U1_DUAL_3BTN_PTP) },
1311+
12931312
/* Anton devices */
12941313
{ .driver_data = MT_CLS_EXPORT_ALL_INPUTS,
12951314
MT_USB_DEVICE(USB_VENDOR_ID_ANTON,

0 commit comments

Comments
 (0)