From fd08b44fab5d58ae177765e02aaba5bd60bbe7c9 Mon Sep 17 00:00:00 2001 From: Li Jun Date: Sat, 6 Jun 2015 11:18:36 +0800 Subject: MLK-11123-10 usb: gadget: add otg descriptor allocate and init interface Allocate usb otg descriptor and initialize it according to gadget's otg capabilities, if usb_otg_caps is not set, keep settings as current gadget drivers. With this 2 new interfaces, gadget can use usb_otg_descriptor for OTG 1.x, and usb_otg20_descriptor for OTG 2.0 or above, and otg features can be decided by the combination of usb hardware property and driver config. Reviewed-by: Roger Quadros Signed-off-by: Li Jun --- include/linux/usb/gadget.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index fb7a2a7ce7dc..ebb199467b00 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -999,6 +999,10 @@ int usb_assign_descriptors(struct usb_function *f, struct usb_descriptor_header **ss); void usb_free_all_descriptors(struct usb_function *f); +struct usb_descriptor_header *usb_otg_descriptor_alloc( + struct usb_gadget *gadget); +int usb_otg_descriptor_init(struct usb_gadget *gadget, + struct usb_descriptor_header *otg_desc); /*-------------------------------------------------------------------------*/ /* utility to simplify map/unmap of usb_requests to/from DMA */ -- cgit v1.2.3