diff options
author | Koen Beel <koen.beel@gmail.com> | 2012-05-30 14:43:37 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2012-06-04 11:11:59 -0400 |
commit | 560f1187990c6c548756bf2f1183aa19d9c97413 (patch) | |
tree | 3127662a8e5149a542382c7c6b040c0cb8e8ee35 /drivers/usb/gadget/f_fs.c | |
parent | d3c568c302ed0e3b2d51f0335f304ca4d85de54b (diff) |
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/f_fs.c')
-rw-r--r-- | drivers/usb/gadget/f_fs.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c index dcd1c7fbb016..8adc79d1b402 100644 --- a/drivers/usb/gadget/f_fs.c +++ b/drivers/usb/gadget/f_fs.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/blkdev.h> | 21 | #include <linux/blkdev.h> |
22 | #include <linux/pagemap.h> | 22 | #include <linux/pagemap.h> |
23 | #include <linux/export.h> | 23 | #include <linux/export.h> |
24 | #include <linux/hid.h> | ||
24 | #include <asm/unaligned.h> | 25 | #include <asm/unaligned.h> |
25 | 26 | ||
26 | #include <linux/usb/composite.h> | 27 | #include <linux/usb/composite.h> |
@@ -1671,6 +1672,12 @@ static int __must_check ffs_do_desc(char *data, unsigned len, | |||
1671 | } | 1672 | } |
1672 | break; | 1673 | break; |
1673 | 1674 | ||
1675 | case HID_DT_HID: | ||
1676 | pr_vdebug("hid descriptor\n"); | ||
1677 | if (length != sizeof(struct hid_descriptor)) | ||
1678 | goto inv_length; | ||
1679 | break; | ||
1680 | |||
1674 | case USB_DT_OTG: | 1681 | case USB_DT_OTG: |
1675 | if (length != sizeof(struct usb_otg_descriptor)) | 1682 | if (length != sizeof(struct usb_otg_descriptor)) |
1676 | goto inv_length; | 1683 | goto inv_length; |