summaryrefslogtreecommitdiffstats
path: root/drivers/usb/gadget
diff options
context:
space:
mode:
authorKoen Beel <koen.beel@gmail.com>2012-05-30 20:43:37 +0200
committerFelipe Balbi <balbi@ti.com>2012-06-04 18:11:59 +0300
commit560f1187990c6c548756bf2f1183aa19d9c97413 (patch)
tree3127662a8e5149a542382c7c6b040c0cb8e8ee35 /drivers/usb/gadget
parentd3c568c302ed0e3b2d51f0335f304ca4d85de54b (diff)
downloadop-kernel-dev-560f1187990c6c548756bf2f1183aa19d9c97413.zip
op-kernel-dev-560f1187990c6c548756bf2f1183aa19d9c97413.tar.gz
usb: gadget: ffs: add HID descriptor support.
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>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r--drivers/usb/gadget/f_fs.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
index dcd1c7f..8adc79d 100644
--- a/drivers/usb/gadget/f_fs.c
+++ b/drivers/usb/gadget/f_fs.c
@@ -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;
OpenPOWER on IntegriCloud