Skip to contentSkip to conversation

HID: hid-samsung: add support for Creative Desktop Wireless 6000

PATCH Jiri Kosina 1 participant 1 message May 17, 2010 1 message not in the archive HID

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

drivers/hid/hid-core.c static const struct hid_device_id hid_bl · line 1346

Quoted 8 lines · Don Prince

diff -X /opt/scripts/diff-exclude.txt -Npaur a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c

drivers/hid/hid-core.c +1 -0
@@ -1343,6 +1343,7 @@ static const struct hid_device_id hid_bl
 	{ HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_OPTICAL_TOUCH) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_PIXART_IMAGING_INC_OPTICAL_TOUCH_SCREEN) },
 	{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) },
+	{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) },

On my side it seems that your mailer whitespace-damaged the patch somehow. Could you please either try to fix up your mailer, or attach the patch as an attachment if it doesn't work inline?

Quoted 20 lines
drivers/hid/hid-core.c +20 -0
+#define samsung_kbd_mouse_map_key_clear(c) \
+	hid_map_usage_clear(hi, usage, bit, max, EV_KEY, (c))
+
+static int samsung_kbd_mouse_input_mapping(struct hid_device *hdev,
+	struct hid_input *hi, struct hid_field *field, struct hid_usage *usage,
+	unsigned long **bit, int *max)
+{
+	struct usb_interface *intf = to_usb_interface(hdev->dev.parent);
+	unsigned short ifnum = intf->cur_altsetting->desc.bInterfaceNumber;
+
+	if (1 != ifnum || HID_UP_CONSUMER != (usage->hid & HID_USAGE_PAGE))
+		return 0;
+
+	dbg_hid("samsung wireless keyboard/mouse input mapping event [0x%x]\n",
+		usage->hid & HID_USAGE);
+
+	switch (usage->hid & HID_USAGE) {
+	/* report 2 */
+	case 0x0b5:
+		samsung_kbd_mouse_map_key_clear(KEY_NEXTSONG);

drivers/hid/hid-core.c static const struct hid_device_id hid_bl

Quoted 10 lines
drivers/hid/hid-core.c +10 -0
+		break;
+	case 0x0b6:
+		samsung_kbd_mouse_map_key_clear(KEY_PREVIOUSSONG);
+		break;
+	case 0x0b7:
+		samsung_kbd_mouse_map_key_clear(KEY_STOPCD);
+		break;
+	case 0x0cd:
+		samsung_kbd_mouse_map_key_clear(KEY_PLAYPAUSE);
+		break;

Could you please use more compact code look for the mappings (i.e. one line per mapping), as done in other drivers and in hid-input itself, so that it's consistent?

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.