diff options
| author | Hemant Kumar <hemantk@codeaurora.org> | 2015-08-26 17:18:36 -0700 |
|---|---|---|
| committer | David Keitel <dkeitel@codeaurora.org> | 2016-03-22 11:07:10 -0700 |
| commit | 92f418332c16491d233a6dfe381a441ccccae0b1 (patch) | |
| tree | b5cd7a0de8634367de374f6de5c64fdf9858b90e /include | |
| parent | a8028071dd84eea4a3c36eb972e0abac5d77696a (diff) | |
usb: dwc3: Add support for POR upon composition switch
Composition switch to GSI transport based composition from
another GSI transport based composition requires power on
reset of USB controller to synchronize operation with USB
wrapper for GSI. Specifically GSI_EN bit cannot be
cleared without performing usb controller reset. Hence
introduce gadget restart operation to simulate vbus off
and vbus on and perform this operation from gsi bind
config.
Change-Id: Ie4695807c73c2d14c0d9e17c486f34a90fd93ddb
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/usb/gadget.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 7c18c70df503..3f572d5dc16d 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -649,6 +649,7 @@ struct usb_gadget_ops { int (*vbus_session) (struct usb_gadget *, int is_active); int (*vbus_draw) (struct usb_gadget *, unsigned mA); int (*pullup) (struct usb_gadget *, int is_on); + int (*restart)(struct usb_gadget *); int (*ioctl)(struct usb_gadget *, unsigned code, unsigned long param); void (*get_config_params)(struct usb_dcd_config_params *); @@ -1049,6 +1050,20 @@ static inline int usb_gadget_disconnect(struct usb_gadget *gadget) } /** + * usb_gadget_restart - software-controlled reset of USB peripheral connection + * @gadget:the peripheral being reset + * + * Informs controller driver for Vbus LOW followed by Vbus HIGH notification. + * This performs full hardware reset and re-initialization. + */ +static inline int usb_gadget_restart(struct usb_gadget *gadget) +{ + if (!gadget->ops->restart) + return -EOPNOTSUPP; + return gadget->ops->restart(gadget); +} + +/** * usb_gadget_deactivate - deactivate function which is not ready to work * @gadget: the peripheral being deactivated * |
