Commit 46e779b0 authored by Sandeep C S's avatar Sandeep C S Committed by Jiri Kosina

HID: samsung: Add Samsung wireless action mouse support

Add support for samsung wireless action mouse with input mapping events.

Device a004 (Samsung wireless action mouse).
Signed-off-by: default avatarSandeep C S <sandeep.cs@samsung.com>
Signed-off-by: default avatarJunwan Cho <junwan.cho@samsung.com>
Signed-off-by: default avatarJitender Sajwan <jitender.s21@samsung.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
parent 944536c2
...@@ -1148,6 +1148,7 @@ ...@@ -1148,6 +1148,7 @@
#define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE 0x0600 #define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE 0x0600
#define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD 0x7021 #define USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD 0x7021
#define USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD 0xa000 #define USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD 0xa000
#define USB_DEVICE_ID_SAMSUNG_WIRELESS_ACTIONMOUSE 0xa004
#define USB_VENDOR_ID_SEMICO 0x1a2c #define USB_VENDOR_ID_SEMICO 0x1a2c
#define USB_DEVICE_ID_SEMICO_USB_KEYKOARD 0x0023 #define USB_DEVICE_ID_SEMICO_USB_KEYKOARD 0x0023
......
...@@ -323,6 +323,29 @@ static int samsung_gamepad_input_mapping(struct hid_device *hdev, ...@@ -323,6 +323,29 @@ static int samsung_gamepad_input_mapping(struct hid_device *hdev,
return 1; return 1;
} }
static int samsung_actionmouse_input_mapping(struct hid_device *hdev,
struct hid_input *hi, struct hid_field *field, struct hid_usage *usage,
unsigned long **bit, int *max)
{
dbg_hid("samsung wireless actionmouse input mapping event [0x%x], [0x%x], %ld, %ld, [0x%x]\n",
usage->hid, usage->hid & HID_USAGE, hi->input->evbit[0], hi->input->absbit[0],
usage->hid & HID_USAGE_PAGE);
if (((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER) && ((usage->hid & HID_USAGE_PAGE) != HID_UP_BUTTON))
return 0;
switch (usage->hid & HID_USAGE) {
case 0x301:
samsung_kbd_mouse_map_key_clear(254);
break;
default:
return 0;
}
return 1;
}
static __u8 *samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc, static __u8 *samsung_report_fixup(struct hid_device *hdev, __u8 *rdesc,
unsigned int *rsize) unsigned int *rsize)
{ {
...@@ -346,6 +369,9 @@ static int samsung_input_mapping(struct hid_device *hdev, struct hid_input *hi, ...@@ -346,6 +369,9 @@ static int samsung_input_mapping(struct hid_device *hdev, struct hid_input *hi,
else if (hdev->product == USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD) else if (hdev->product == USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD)
ret = samsung_gamepad_input_mapping(hdev, ret = samsung_gamepad_input_mapping(hdev,
hi, field, usage, bit, max); hi, field, usage, bit, max);
else if (hdev->product == USB_DEVICE_ID_SAMSUNG_WIRELESS_ACTIONMOUSE)
ret = samsung_actionmouse_input_mapping(hdev,
hi, field, usage, bit, max);
return ret; return ret;
} }
...@@ -390,6 +416,7 @@ static const struct hid_device_id samsung_devices[] = { ...@@ -390,6 +416,7 @@ static const struct hid_device_id samsung_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) }, { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD) }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_GAMEPAD) },
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SAMSUNG_ELECTRONICS, USB_DEVICE_ID_SAMSUNG_WIRELESS_ACTIONMOUSE) },
{ } { }
}; };
MODULE_DEVICE_TABLE(hid, samsung_devices); MODULE_DEVICE_TABLE(hid, samsung_devices);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment