Some gadget drivers might benefit from having
separate ->disconnect and ->reset notifications.

For those gadget drivers which don't care, they
can implement only ->disconnect and UDC driver
is required to call ->disconnect case ->reset
isn't valid.

Signed-off-by: Felipe Balbi <ba...@ti.com>
---
 include/linux/usb/gadget.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 9517466..57de0e8 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -781,6 +781,10 @@ static inline int usb_gadget_disconnect(struct usb_gadget 
*gadget)
  *     when the host is disconnected.  May be called in_interrupt; this
  *     may not sleep.  Some devices can't detect disconnect, so this might
  *     not be called except as part of controller shutdown.
+ * @reset: Invoked from reset interrupt handler. This call may not sleep.
+ *     Some gadget drivers might benefit from having a different @reset
+ *     and @disconnect methods. For those which don't provide @reset,
+ *     UDC driver is expected to call @disconnect.
  * @unbind: Invoked when the driver is unbound from a gadget,
  *     usually from rmmod (after a disconnect is reported).
  *     Called in a context that permits sleeping.
@@ -839,6 +843,7 @@ struct usb_gadget_driver {
        int                     (*setup)(struct usb_gadget *,
                                        const struct usb_ctrlrequest *);
        void                    (*disconnect)(struct usb_gadget *);
+       void                    (*reset)(struct usb_gadget *);
        void                    (*suspend)(struct usb_gadget *);
        void                    (*resume)(struct usb_gadget *);
 
-- 
1.7.12.rc2

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to