diff options
author | Peter Chen <peter.chen@freescale.com> | 2014-09-12 09:32:41 +0800 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-09-12 09:12:51 -0500 |
commit | 974a70bdecea5296db1b643e4046ef208e99c592 (patch) | |
tree | 040d2ee0578c85b155fe91a3f5bfe13905e2ed32 /drivers/usb/gadget | |
parent | 1f7c51660034091dc134fcc534b7f1fa86a6e823 (diff) | |
download | linux-974a70bdecea5296db1b643e4046ef208e99c592.tar.bz2 |
usb: gadget: udc-core: add utility for bus reset
The udc driver can notify the udc core that bus reset occurs by
calling this utility, the core will notify gadget driver this
information and update gadget state accordingly.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/gadget')
-rw-r--r-- | drivers/usb/gadget/udc/udc-core.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/usb/gadget/udc/udc-core.c b/drivers/usb/gadget/udc/udc-core.c index b0d98172bc07..ba661c6da54a 100644 --- a/drivers/usb/gadget/udc/udc-core.c +++ b/drivers/usb/gadget/udc/udc-core.c @@ -124,6 +124,23 @@ EXPORT_SYMBOL_GPL(usb_gadget_set_state); /* ------------------------------------------------------------------------- */ /** + * usb_gadget_udc_reset - notifies the udc core that bus reset occurs + * @gadget: The gadget which bus reset occurs + * @driver: The gadget driver we want to notify + * + * If the udc driver has bus reset handler, it needs to call this when the bus + * reset occurs, it notifies the gadget driver that the bus reset occurs as + * well as updates gadget state. + */ +void usb_gadget_udc_reset(struct usb_gadget *gadget, + struct usb_gadget_driver *driver) +{ + driver->reset(gadget); + usb_gadget_set_state(gadget, USB_STATE_DEFAULT); +} +EXPORT_SYMBOL_GPL(usb_gadget_udc_reset); + +/** * usb_gadget_udc_start - tells usb device controller to start up * @gadget: The gadget we want to get started * @driver: The driver we want to bind to @gadget |