USB: add support for Dream Cheeky DL100B Webmail Notifier (1d34:0004)
PATCH v2 1/1 USB: add support for Dream Cheeky DL100B Webmail Notifier (1d34:0004)
From: Melchior FRANZ <[email protected]>
So far the USBLED driver only supports Delcom's "USB Visual Signal Indicator" (http://www.delcomproducts.com/products_USBLMP.asp). The driver generates virtual files "red", "green", and "blue" under the device's /sys/ directory, where color values can be read from and written to.
This patch adds support for Dream Cheeky's "DL100B Webmail Notifier"
(http://www.dreamcheeky.com/webmail-notifier -- available from several shops, such as http://www.conrad.at/ce/de/product/777048/USB-WEBMAIL).
This device isn't as pretty as Delcom's, but it's *far* cheaper, and its 3 LEDs can be set in 32 brightness steps each. The grey envelope contour can easily be removed, leaving a rather neutral white box (with a few small holes), which is useful for generic signalling purposes. Of course, the small circuit board can easily be put into a prettier case.
The DL100B device pretends to be a HID, but the HID descriptor shows that it's not overly useful as such (see below). The patch therefore removes the "HID-ness" (hid-core.c, hid-ids.h), and adds the necessary commands to usbled.c. The protocol info comes from the developer's manual that Dream Cheeky kindly provided (815DeveloperManual.pdf).
HID descriptor:
0: 05 01 Usage Page 'Generic Desktop Controls' 2: 09 10 Usage 'Reserved' 4: a1 01 Collection 'Application (mouse, keyboard)' 6: 05 00 Usage Page 'Undefined' 8: 19 10 Usage Minimum = 16 10: 29 11 Usage Maximum = 17 12: 15 00 Logical Minimum = 0 14: 25 0f Logical Maximum = 15 16: 75 08 Report Size = 8 18: 95 08 Report Count = 8 20: 91 02 Output data *var abs lin pref-state null-pos non-vol bit-field 22: 19 10 Usage Minimum = 16 24: 29 11 Usage Maximum = 17 26: 15 00 Logical Minimum = 0 28: 25 0f Logical Maximum = 15 30: 75 08 Report Size = 8 32: 95 08 Report Count = 8 34: 81 00 Input data array abs lin pref-state null-pos non-vol bit-field
36: c0 End Collection
---
Greg: I hope I understood your instructions correctly. :-)
Some notes:
- I increased the file's version number (1.1 -> 1.2). Hope that's OK.
- There were two differently capitalized ENOMEM messages with the same contents before, and as I had to add a third one, I de-capitalized one for consistency reasons.
- The patch removes the three color #define-s, as they are no longer suitable on the top level, and puts the values directly in the code. This should be clear enough, as the respective color is mentioned in the line before. (I considered to use "const" values or an enum, but both generated different, more verbose code.)
Please review again and consider for inclusion. (The patch is diffed against 2.6.36.2.)
drivers/hid/hid-core.c | 1 + drivers/hid/hid-ids.h | 2 + drivers/usb/misc/usbled.c | 118 ++++++++++++++++++++++++++++++++++----------- 3 files changed, 93 insertions(+), 28 deletions(-)
drivers/hid/hid-core.c +1 -0
@@ -1594,6 +1594,7 @@ static const struct hid_device_id hid_ignore_list[] = { { HID_USB_DEVICE(USB_VENDOR_ID_DEALEXTREAME, USB_DEVICE_ID_DEALEXTREAME_RADIO_SI4701) }, { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EARTHMATE) }, { HID_USB_DEVICE(USB_VENDOR_ID_DELORME, USB_DEVICE_ID_DELORME_EM_LT20) }, + { HID_USB_DEVICE(USB_VENDOR_ID_DREAM_CHEEKY, 0x0004) }, { HID_USB_DEVICE(USB_VENDOR_ID_ESSENTIAL_REALITY, USB_DEVICE_ID_ESSENTIAL_REALITY_P5) }, { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC5UH) }, { HID_USB_DEVICE(USB_VENDOR_ID_ETT, USB_DEVICE_ID_TC4UM) },
drivers/hid/hid-ids.h +2 -0
@@ -197,6 +197,8 @@#define USB_VENDOR_ID_ELECOM 0x056e#define USB_DEVICE_ID_ELECOM_BM084 0x0061 +#define USB_VENDOR_ID_DREAM_CHEEKY 0x1d34 +#define USB_VENDOR_ID_ELO 0x04E7#define USB_DEVICE_ID_ELO_TS2700 0x0020
drivers/usb/misc/usbled.c +90 -28
164 lines not on this page · raw message
Quoted 4 lines · Melchior FRANZ
Greg: I hope I understood your instructions correctly. :-)
Some notes:
- I increased the file's version number (1.1 -> 1.2). Hope that's OK.
Actually, you could just remove it, it's pretty pointless :)
Quoted 3 lines
- There were two differently capitalized ENOMEM messages with the same contents before, and as I had to add a third one, I de-capitalized one for consistency reasons.
That's fine.
Quoted 5 lines
- The patch removes the three color #define-s, as they are no longer suitable on the top level, and puts the values directly in the code. This should be clear enough, as the respective color is mentioned in the line before. (I considered to use "const" values or an enum, but both generated different, more verbose code.)
That's fine too.
Quoted 2 lines
Please review again and consider for inclusion. (The patch is diffed against 2.6.36.2.)
I would, but it looks like you didn't test this patch out by building it as the following line really would not compile properly at all, right:
drivers/usb/misc/usbled.c static void change_color(struct usb_led *led) · line 103
Quoted 9 lines
drivers/usb/misc/usbled.c +9
-0+ retval =usb_control_msg (led->udev, +usb_sndctrlpipe (led->udev,0 ), +0x09 , +0x21 , + 0x200, The price difference to Delcom's thingy lets you a lot of room. :-) +0 , + buffer, +8 , +2000 );
I think you might want to fix that up :)
Care to resend?
Third times a charm?
thanks,
greg k-h
* Greg KH -- Wednesday 22 December 2010:
Quoted 4 lines · Melchior FRANZ
Quoted 1 line
- I increased the file's version number (1.1 -> 1.2). Hope that's OK.
Actually, you could just remove it, it's pretty pointless :)
Yeah, that's what I thought. But leaving it at 1.1 was even more pointless, so I aimed for the most conservative solution. :-)
Quoted 4 lines
I would, but it looks like you didn't test this patch out by building it as the following line really would not compile properly at all, right:
drivers/usb/misc/usbled.c static void change_color(struct usb_led *led) · line 99
Quoted 1 line
drivers/usb/misc/usbled.c +1
-0+ 0x200, The price difference to Delcom's thingy lets you a lot of room. :-)
Of course, I tested it. That garbage is not in the code, or in the generated diff. This happened after importing the correct diff into kmail. Probably and accidantal MMB click. Sigh. OK, it's my fault, no matter what ...
Quoted 1 line
Third times a charm?
Heh. Coming along ...
Thanks for reviewing.
m.