mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
usb: dwc3: omap: don't miss events during suspend/resume
The USB cable state can change during suspend/resume so be sure to check and update the extcon state. Signed-off-by: Roger Quadros <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
This commit is contained in:
parent
675272d092
commit
c49f63055e
1 changed files with 16 additions and 0 deletions
|
|
@ -582,9 +582,25 @@ static int dwc3_omap_resume(struct device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void dwc3_omap_complete(struct device *dev)
|
||||
{
|
||||
struct dwc3_omap *omap = dev_get_drvdata(dev);
|
||||
|
||||
if (extcon_get_state(omap->edev, EXTCON_USB))
|
||||
dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_VALID);
|
||||
else
|
||||
dwc3_omap_set_mailbox(omap, OMAP_DWC3_VBUS_OFF);
|
||||
|
||||
if (extcon_get_state(omap->edev, EXTCON_USB_HOST))
|
||||
dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_GROUND);
|
||||
else
|
||||
dwc3_omap_set_mailbox(omap, OMAP_DWC3_ID_FLOAT);
|
||||
}
|
||||
|
||||
static const struct dev_pm_ops dwc3_omap_dev_pm_ops = {
|
||||
|
||||
SET_SYSTEM_SLEEP_PM_OPS(dwc3_omap_suspend, dwc3_omap_resume)
|
||||
.complete = dwc3_omap_complete,
|
||||
};
|
||||
|
||||
#define DEV_PM_OPS (&dwc3_omap_dev_pm_ops)
|
||||
|
|
|
|||
Loading…
Reference in a new issue