aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/usb/gadget.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index d8128f7102c9..cf468fbdbf8e 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -114,6 +114,8 @@ struct usb_ep_ops {
114 int (*dequeue) (struct usb_ep *ep, struct usb_request *req); 114 int (*dequeue) (struct usb_ep *ep, struct usb_request *req);
115 115
116 int (*set_halt) (struct usb_ep *ep, int value); 116 int (*set_halt) (struct usb_ep *ep, int value);
117 int (*set_wedge) (struct usb_ep *ep);
118
117 int (*fifo_status) (struct usb_ep *ep); 119 int (*fifo_status) (struct usb_ep *ep);
118 void (*fifo_flush) (struct usb_ep *ep); 120 void (*fifo_flush) (struct usb_ep *ep);
119}; 121};
@@ -349,6 +351,25 @@ static inline int usb_ep_clear_halt(struct usb_ep *ep)
349} 351}
350 352
351/** 353/**
354 * usb_ep_set_wedge - sets the halt feature and ignores clear requests
355 * @ep: the endpoint being wedged
356 *
357 * Use this to stall an endpoint and ignore CLEAR_FEATURE(HALT_ENDPOINT)
358 * requests. If the gadget driver clears the halt status, it will
359 * automatically unwedge the endpoint.
360 *
361 * Returns zero on success, else negative errno.
362 */
363static inline int
364usb_ep_set_wedge(struct usb_ep *ep)
365{
366 if (ep->ops->set_wedge)
367 return ep->ops->set_wedge(ep);
368 else
369 return ep->ops->set_halt(ep, 1);
370}
371
372/**
352 * usb_ep_fifo_status - returns number of bytes in fifo, or error 373 * usb_ep_fifo_status - returns number of bytes in fifo, or error
353 * @ep: the endpoint whose fifo status is being checked. 374 * @ep: the endpoint whose fifo status is being checked.
354 * 375 *