Prev: [PATCH] GPIO: rdc321x fix inverted gpio data out registers
Next: [PATCH 2.6.34-rc7 v2] HID: hid-samsung: add support for Creative Desktop Wireless 6000
From: Robert Schedel on 16 May 2010 06:50 Hello, On 16.05.2010 02:32, Don Prince wrote: > Add support for the Creative Desktop Wireless 6000 keyboard/mouse > bundle's multimedia buttons which are not currently handled by > the default/samsung HID driver. > > Signed-off-by: Don Prince <dhprince-devel(a)yahoo.co.uk> > > --- > [...] As originator of the "old" 0419:0001 IrDA driver parts had a short look at it: - Merging with old code looks OK. Tested with old 0419:0001 (184) device, still functional. - 0419:0600 not yet known in usb.ids, might be worth a contribution - As you merged in a new device, and for explaining why this handling was added, my suggestion is to adapt the existing comments, e.g.: /* * This driver supports several HID devices: * * [0419:0001] Samsung IrDA remote controller (reports as Cypress USB Mouse). * * There are several variants: * * 1. 184 byte report descriptor [...] * [0419:0600] Creative Desktop Wireless 6000 keyboard/mouse combo * * Several key mappings used from the consumer usage page * deviate from the USB HUT 1.12 standard. */ Of course some HID maintainer should also review it, for general policy. Regards, Robert Schedel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: don on 16 May 2010 08:20 On 16/05/10 11:33, Robert Schedel wrote: > Hello, > > On 16.05.2010 02:32, Don Prince wrote: > >> Add support for the Creative Desktop Wireless 6000 keyboard/mouse >> bundle's multimedia buttons which are not currently handled by >> the default/samsung HID driver. >> >> Signed-off-by: Don Prince <dhprince-devel(a)yahoo.co.uk> >> >> --- >> [...] >> > As originator of the "old" 0419:0001 IrDA driver parts had a short look at it: > - Merging with old code looks OK. Tested with old 0419:0001 (184) device, still functional. > - 0419:0600 not yet known in usb.ids, might be worth a contribution > - As you merged in a new device, and for explaining why this handling was added, my suggestion is to adapt the existing comments, e.g.: > > /* > * This driver supports several HID devices: > * > * [0419:0001] Samsung IrDA remote controller (reports as Cypress USB Mouse). > * > * There are several variants: > * > * 1. 184 byte report descriptor > [...] > * [0419:0600] Creative Desktop Wireless 6000 keyboard/mouse combo > * > * Several key mappings used from the consumer usage page > * deviate from the USB HUT 1.12 standard. > */ > > Of course some HID maintainer should also review it, for general policy. > > Regards, > Robert Schedel > > Ok I'll add some comments and re-submit patch as v2. Regards Don Prince -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Jiri Kosina on 17 May 2010 04:40 On Sun, 16 May 2010, Don Prince wrote: > diff -X /opt/scripts/diff-exclude.txt -Npaur a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c > --- a/drivers/hid/hid-core.c 2010-05-15 15:38:23.938711974 +0100 > +++ b/drivers/hid/hid-core.c 2010-05-15 20:43:36.363484676 +0100 > @@ -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? > +#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); > + 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, -- Jiri Kosina SUSE Labs, Novell Inc. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Jiri Kosina on 17 May 2010 07:40 On Mon, 17 May 2010, Don Prince wrote: > Add support for the multimedia buttons of the Creative Desktop Wireless > 6000 keyboard/mouse combo which are not currently handled by the > default/samsung HID driver. > > Signed-off-by: Don Prince <dhprince-devel(a)yahoo.co.uk> > > --- > > Added comments as requested by Robert Schedel <r.schedel(a)yahoo.de> > > As requested by Jiri Kosina, made key mapping code more concise > i.e. ignored checkpatch.pl's wingeing about code style. Applied, thanks. -- Jiri Kosina SUSE Labs, Novell Inc. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
From: Robert Schedel on 17 May 2010 13:20
Hello, sorry for one late observation: On 17.05.2010 12:42, Don Prince wrote: > Add support for the multimedia buttons of the Creative Desktop Wireless > 6000 keyboard/mouse combo which are not currently handled by the > default/samsung HID driver. > > Signed-off-by: Don Prince <dhprince-devel(a)yahoo.co.uk> > > --- > > Added comments as requested by Robert Schedel <r.schedel(a)yahoo.de> > > As requested by Jiri Kosina, made key mapping code more concise > i.e. ignored checkpatch.pl's wingeing about code style. [...] > + switch (usage->hid & HID_USAGE) { > + /* report 2 */ > + case 0x0b5: samsung_kbd_mouse_map_key_clear(KEY_NEXTSONG); 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; > + case 0x0e2: samsung_kbd_mouse_map_key_clear(KEY_MUTE); break; > + case 0x0e9: samsung_kbd_mouse_map_key_clear(KEY_VOLUMEUP); break; > + case 0x0ea: samsung_kbd_mouse_map_key_clear(KEY_VOLUMEDOWN); break; Those seven are identical to hid-input.c mapping (HUT 1.1 compliant) and could simply be deleted. Daisy chaining via default case below, right? > + case 0x183: samsung_kbd_mouse_map_key_clear(KEY_MEDIA); break; > + case 0x195: samsung_kbd_mouse_map_key_clear(KEY_EMAIL); break; > + case 0x196: samsung_kbd_mouse_map_key_clear(KEY_CALC); break; > + case 0x197: samsung_kbd_mouse_map_key_clear(KEY_COMPUTER); break; > + case 0x22b: samsung_kbd_mouse_map_key_clear(KEY_SEARCH); break; > + case 0x22c: samsung_kbd_mouse_map_key_clear(KEY_WWW); break; > + case 0x22d: samsung_kbd_mouse_map_key_clear(KEY_BACK); break; > + case 0x22e: samsung_kbd_mouse_map_key_clear(KEY_FORWARD); break; > + case 0x22f: samsung_kbd_mouse_map_key_clear(KEY_FAVORITES); break; > + case 0x230: samsung_kbd_mouse_map_key_clear(KEY_REFRESH); break; > + case 0x231: samsung_kbd_mouse_map_key_clear(KEY_STOP); break; > + default: > + return 0; Regards, Robert Schedel -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |