aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoen Beel <koen.beel@gmail.com>2012-05-30 20:43:37 +0200
committerJulian Veit <claymore1298@gmail.com>2020-11-12 07:51:04 +0100
commitb9682167be44325caab3779e63f4fa9a93e1d59d (patch)
tree045145ea9362c7981f4fd3b6c06d5ae436cc82ce
parent9928995f050f34d27bfb6f6e81700980b2a8b331 (diff)
usb: gadget: ffs: add HID descriptor support.q10.0
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> Change-Id: Id0f930e12a84315995a3ea4d08757ba1f3b567be
-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 24fd117c3cb..5ccee1eaff2 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>
@@ -1775,6 +1776,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;