Skip to content

Commit

Permalink
usb: gadget: ffs: add HID descriptor support.
Browse files Browse the repository at this point in the history
When writing the descriptors to the ep0 file of functionfs, the HID descriptors where not recognized which caused the initialization from user space to fail.

Signed-off-by: Koen Beel <koen.beel@barco.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Koen Beel authored and Felipe Balbi committed Jun 4, 2012
1 parent d3c568c commit 560f118
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/usb/gadget/f_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include <linux/blkdev.h>
#include <linux/pagemap.h>
#include <linux/export.h>
#include <linux/hid.h>
#include <asm/unaligned.h>

#include <linux/usb/composite.h>
Expand Down Expand Up @@ -1671,6 +1672,12 @@ static int __must_check ffs_do_desc(char *data, unsigned len,
}
break;

case HID_DT_HID:
pr_vdebug("hid descriptor\n");
if (length != sizeof(struct hid_descriptor))
goto inv_length;
break;

case USB_DT_OTG:
if (length != sizeof(struct usb_otg_descriptor))
goto inv_length;
Expand Down

0 comments on commit 560f118

Please sign in to comment.