usb: gadget: ffs: add HID descriptor support.
authorKoen Beel <koen.beel@gmail.com>
Wed, 30 May 2012 18:43:37 +0000 (20:43 +0200)
committerFelipe Balbi <balbi@ti.com>
Mon, 4 Jun 2012 15:11:59 +0000 (18:11 +0300)
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>
drivers/usb/gadget/f_fs.c

index dcd1c7f..8adc79d 100644 (file)
@@ -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>
@@ -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;