aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@freescale.com>2014-09-09 08:56:48 +0800
committerFelipe Balbi <balbi@ti.com>2014-09-09 09:58:09 -0500
commitef979a26e3d521d51dbd9950e46a69e303073171 (patch)
treedb43d334740f1aa8efc162747f1bdc928690934b /include/linux/usb
parentusb: gadget: f_fs: signedness bug in __ffs_func_bind_do_descs() (diff)
downloadlinux-dev-ef979a26e3d521d51dbd9950e46a69e303073171.tar.xz
linux-dev-ef979a26e3d521d51dbd9950e46a69e303073171.zip
usb: gadget: add reset API at usb_gadget_driver
Adding reset API for UDC bus reset handler is useful for below two issues. Current disconnect API at usb_gadget_driver is also invoked at udc's bus reset handler, but the document says it is invoked when the host is disconnected. Besides, we may expect the gadget_driver to do different things for host sends bus reset and host disconnects gadget, eg, we may not want to flush dirty page for mass storage at bus reset, and want to do it at disconnection. Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'include/linux/usb')
-rw-r--r--include/linux/usb/gadget.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index c540557b564b..598a6e9b2850 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -817,6 +817,8 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget)
* Called in a context that permits sleeping.
* @suspend: Invoked on USB suspend. May be called in_interrupt.
* @resume: Invoked on USB resume. May be called in_interrupt.
+ * @reset: Invoked on USB bus reset. It is mandatory for all gadget drivers
+ * and should be called in_interrupt.
* @driver: Driver model state for this driver.
*
* Devices are disabled till a gadget driver successfully bind()s, which
@@ -874,6 +876,7 @@ struct usb_gadget_driver {
void (*disconnect)(struct usb_gadget *);
void (*suspend)(struct usb_gadget *);
void (*resume)(struct usb_gadget *);
+ void (*reset)(struct usb_gadget *);
/* FIXME support safe rmmod */
struct device_driver driver;