Rockbox

Tasklist

FS#10116 - USB HID class driver

Attached to Project: Rockbox
Opened by Tomer Shalev (tomers) - Thursday, 09 April 2009, 18:27 GMT
Last edited by Frank Gevaerts (fg) - Sunday, 19 April 2009, 21:18 GMT
Task Type Patches
Category Drivers
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version Version 3.2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

This is part of GSoC 2009.
The first stage is an admission assignment to create a skeleton for a new USB class driver.
The final mission is to create a working HID class driver, which make it possible for the DAP to be registered as a sort of keypad, so that pressing the DAP's keys will send key click event to the OS (Volume Up/Down, Mute, etc.)
Closed by  Frank Gevaerts (fg)
Sunday, 19 April 2009, 21:18 GMT
Reason for closing:  Accepted
Additional comments about closing:  Committed as r20750
Comment by Tomer Shalev (tomers) - Friday, 17 April 2009, 23:24 GMT
The attached patch is a working HID class driver for Sansa-E200V1 (should work on other targets too).
When the DAP connects to a Windows host, it is recognized as a USB Composite Device, which is composed of both Mass Storage device and Human Interface Device.

This work is done as part of GSoC project that I have enrolled for.

Todo:
* Implement sending keystrokes (Volume Up/Down when scrolling the scrollwheel).
* Extract USB class drivers outside rockbox binary (plugin like).

Notice: The patch is still 'dirty'. It's 2:30am, and I'm a bit tired. I'll post a cleaner patch soon.
Comment by Frank Gevaerts (fg) - Friday, 17 April 2009, 23:45 GMT
Nice! I'll have a close look at it soon, but I need to sleep first as well :)
Comment by Frank Gevaerts (fg) - Saturday, 18 April 2009, 14:30 GMT
It looks like you have several more or less independent parts in this patch :
* reorganisation of usb_core.c
* some cleanup of usb_storage.c and usb_serial.c
* the hid implementation

I think it would be useful for ease of reviewing if those were in separate patches.

Since this is a first "dirty" patch, I don't think it makes much sense for me to go through it in detail yet
Comment by Tomer Shalev (tomers) - Saturday, 18 April 2009, 16:21 GMT
> I think it would be useful for ease of reviewing if those were in separate patches.

Agreed, of course.

I've created the first patch in the series:
 FS#10142  - Sync firmware/export/usb_ch9.h with Linux's ch9.h

I am currently not able to commit it, of course, and also I am not able to make these FS items dependent on each other. Please do so.
Comment by Tomer Shalev (tomers) - Saturday, 18 April 2009, 17:00 GMT
Added:  FS#10144  - USB header files cosmetics.
Real code will follow soon...
Comment by Maurus Cuelenaere (mcuelenaere) - Sunday, 19 April 2009, 12:32 GMT
This is a cleaned version of the patch (works on the Onda VX747 too).
Comment by Tomer Shalev (tomers) - Sunday, 19 April 2009, 12:38 GMT
mcuelenaere: Today I am about to commit (with the help of gevaerts) the rest of the patch, so I hope you did not wasted too much time on it.

Have you changed anything from the original patch, besides removing the changes that were already included in the tree?

Tomer
Comment by Maurus Cuelenaere (mcuelenaere) - Sunday, 19 April 2009, 15:19 GMT
No, I haven't changed anything; I just left out the irrelevant changes.
Comment by Tomer Shalev (tomers) - Sunday, 19 April 2009, 20:53 GMT
This patch is ready to commit. It compiles fine, and the HID class driver enumerates well on Windows Vista. tested on Sansa e200v1.

To use it, uncomment USB_HID define in firmware/export/usb_core.h

The class does nothing more than merely enumerating. Still there's HID functionality to implement, such as volume and playback control.

To the commiter (gevaerts): Please close this task once this patch is committed. Later additions to the HID class driver will be done in a separate FS item.

Loading...