Skip to content

Commit b8d63f5

Browse files
committed
xhci: Add hub_control to xhci_driver_overrides
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2122414 Upstream Status: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git Tested: Verify USB-A and USB-C are functional on Nvidia Orin board, and no regressions on other platforms. commit 592338d Author: Jim Lin <jilin@nvidia.com> Date: Fri Nov 11 18:18:11 2022 +0800 xhci: Add hub_control to xhci_driver_overrides Add a hub_control() callback to the xhci_driver_overrides structure to allow host drivers to override the default hub_control function. This is required for Tegra which requires device specific actions for power management to be executed during USB state transitions. Signed-off-by: Jim Lin <jilin@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Acked-by: Thierry Reding <treding@nvidia.com> Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com> Link: https://lore.kernel.org/r/20221111101813.32482-2-jilin@nvidia.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 592338d) Signed-off-by: David Marlin <dmarlin@redhat.com>
1 parent 0d3bbe2 commit b8d63f5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

drivers/usb/host/xhci.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5494,6 +5494,8 @@ void xhci_init_driver(struct hc_driver *drv,
54945494
drv->check_bandwidth = over->check_bandwidth;
54955495
if (over->reset_bandwidth)
54965496
drv->reset_bandwidth = over->reset_bandwidth;
5497+
if (over->hub_control)
5498+
drv->hub_control = over->hub_control;
54975499
}
54985500
}
54995501
EXPORT_SYMBOL_GPL(xhci_init_driver);

drivers/usb/host/xhci.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1944,6 +1944,8 @@ struct xhci_driver_overrides {
19441944
struct usb_host_endpoint *ep);
19451945
int (*check_bandwidth)(struct usb_hcd *, struct usb_device *);
19461946
void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *);
1947+
int (*hub_control)(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
1948+
u16 wIndex, char *buf, u16 wLength);
19471949
};
19481950

19491951
#define XHCI_CFC_DELAY 10

0 commit comments

Comments
 (0)