Commit 560f1187 authored by Koen Beel's avatar Koen Beel Committed by Felipe Balbi

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: default avatarKoen Beel <koen.beel@barco.com>
Signed-off-by: default avatarFelipe Balbi <balbi@ti.com>
parent d3c568c3
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment