ANDROID: usb: host: add bus_suspend/bus_resume to xhci overrides
There're several power scenarios depending on vendors.
It gives vendors flexibilty to meet their power requirement.
They can override suspend and resume of root hub.
Bug: 183761108
Signed-off-by: Daehwan Jung <dh10.jung@samsung.com>
Change-Id: Icf00d72d2657fe3433afa00541d25d1910e95954
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 37353ff..b5516e3 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -5404,6 +5404,10 @@ void xhci_init_driver(struct hc_driver *drv,
drv->reset_bandwidth = over->reset_bandwidth;
if (over->address_device)
drv->address_device = over->address_device;
+ if (over->bus_suspend)
+ drv->bus_suspend = over->bus_suspend;
+ if (over->bus_resume)
+ drv->bus_resume = over->bus_resume;
}
}
EXPORT_SYMBOL_GPL(xhci_init_driver);
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 6300347..eb9cef39 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1949,6 +1949,8 @@ struct xhci_driver_overrides {
int (*check_bandwidth)(struct usb_hcd *, struct usb_device *);
void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *);
int (*address_device)(struct usb_hcd *hcd, struct usb_device *udev);
+ int (*bus_suspend)(struct usb_hcd *hcd);
+ int (*bus_resume)(struct usb_hcd *hcd);
};
#define XHCI_CFC_DELAY 10