@@ -323,6 +323,29 @@ static int samsung_gamepad_input_mapping(struct hid_device *hdev,
323
323
return 1 ;
324
324
}
325
325
326
+ static int samsung_actionmouse_input_mapping (struct hid_device * hdev ,
327
+ struct hid_input * hi , struct hid_field * field , struct hid_usage * usage ,
328
+ unsigned long * * bit , int * max )
329
+ {
330
+
331
+ dbg_hid ("samsung wireless actionmouse input mapping event [0x%x], [0x%x], %ld, %ld, [0x%x]\n" ,
332
+ usage -> hid , usage -> hid & HID_USAGE , hi -> input -> evbit [0 ], hi -> input -> absbit [0 ],
333
+ usage -> hid & HID_USAGE_PAGE );
334
+
335
+ if (((usage -> hid & HID_USAGE_PAGE ) != HID_UP_CONSUMER ) && ((usage -> hid & HID_USAGE_PAGE ) != HID_UP_BUTTON ))
336
+ return 0 ;
337
+
338
+ switch (usage -> hid & HID_USAGE ) {
339
+ case 0x301 :
340
+ samsung_kbd_mouse_map_key_clear (254 );
341
+ break ;
342
+ default :
343
+ return 0 ;
344
+ }
345
+
346
+ return 1 ;
347
+ }
348
+
326
349
static __u8 * samsung_report_fixup (struct hid_device * hdev , __u8 * rdesc ,
327
350
unsigned int * rsize )
328
351
{
@@ -346,6 +369,9 @@ static int samsung_input_mapping(struct hid_device *hdev, struct hid_input *hi,
346
369
else if (hdev -> product == USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD )
347
370
ret = samsung_gamepad_input_mapping (hdev ,
348
371
hi , field , usage , bit , max );
372
+ else if (hdev -> product == USB_DEVICE_ID_SAMSUNG_WIRELESS_ACTIONMOUSE )
373
+ ret = samsung_actionmouse_input_mapping (hdev ,
374
+ hi , field , usage , bit , max );
349
375
350
376
return ret ;
351
377
}
@@ -390,6 +416,7 @@ static const struct hid_device_id samsung_devices[] = {
390
416
{ HID_USB_DEVICE (USB_VENDOR_ID_SAMSUNG , USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE ) },
391
417
{ HID_BLUETOOTH_DEVICE (USB_VENDOR_ID_SAMSUNG_ELECTRONICS , USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD ) },
392
418
{ HID_BLUETOOTH_DEVICE (USB_VENDOR_ID_SAMSUNG_ELECTRONICS , USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD ) },
419
+ { HID_BLUETOOTH_DEVICE (USB_VENDOR_ID_SAMSUNG_ELECTRONICS , USB_DEVICE_ID_SAMSUNG_WIRELESS_ACTIONMOUSE ) },
393
420
{ }
394
421
};
395
422
MODULE_DEVICE_TABLE (hid , samsung_devices );
0 commit comments