From cd3b5ff53588737f340cde75a62940290ee76268 Mon Sep 17 00:00:00 2001 From: Daehwan Jung Date: Thu, 1 Apr 2021 15:13:56 +0900 Subject: [PATCH] ANDROID: usb: host: add address_device to xhci overrides Co-processor needs some information about connected usb device. It's proper to pass information after usb device gets address when getting "Set Address" command. It supports vendors to implement it using 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 Change-Id: I51e4d190a6a110f987139d394621590fa40ea6a6 Signed-off-by: Daehwan Jung Signed-off-by: JaeHun Jung Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci.c | 6 ++++++ drivers/usb/host/xhci.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 4f33afa418b0..37150680cc41 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -5619,6 +5619,12 @@ void xhci_init_driver(struct hc_driver *drv, drv->reset_bandwidth = over->reset_bandwidth; if (over->update_hub_device) drv->update_hub_device = over->update_hub_device; + 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 eb2e66a68693..a5e69f7ba28a 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1963,6 +1963,9 @@ struct xhci_driver_overrides { void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); int (*update_hub_device)(struct usb_hcd *hcd, struct usb_device *hdev, struct usb_tt *tt, gfp_t mem_flags); + 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