summaryrefslogtreecommitdiffstats
path: root/include/linux/usb/gadget.h
diff options
context:
space:
mode:
authorFelipe Balbi <balbi@ti.com>2011-12-15 13:31:48 +0200
committerFelipe Balbi <balbi@ti.com>2012-02-28 14:48:23 +0200
commita698908d3b3be915ac20cd37faeff1216f6b4fe8 (patch)
tree208d35c5bc9d49ab5fcb65dd380429cc532426bd /include/linux/usb/gadget.h
parentc15e03e1553d8fb334de26727b0edadd582a46e7 (diff)
downloadop-kernel-dev-a698908d3b3be915ac20cd37faeff1216f6b4fe8.zip
op-kernel-dev-a698908d3b3be915ac20cd37faeff1216f6b4fe8.tar.gz
usb: gadget: add generic map/unmap request utilities
such utilities are currently duplicated on all UDC drivers basically with the same structure. Let's group all implementations into one generic implementation and get rid of that duplication. Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'include/linux/usb/gadget.h')
-rw-r--r--include/linux/usb/gadget.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index da653b5..9517466 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -950,6 +950,16 @@ static inline void usb_free_descriptors(struct usb_descriptor_header **v)
/*-------------------------------------------------------------------------*/
+/* utility to simplify map/unmap of usb_requests to/from DMA */
+
+extern int usb_gadget_map_request(struct usb_gadget *gadget,
+ struct usb_request *req, int is_in);
+
+extern void usb_gadget_unmap_request(struct usb_gadget *gadget,
+ struct usb_request *req, int is_in);
+
+/*-------------------------------------------------------------------------*/
+
/* utility wrapping a simple endpoint selection policy */
extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *,
OpenPOWER on IntegriCloud