xhci: Add hub_control to xhci_driver_overrides
authorJim Lin <jilin@nvidia.com>
Fri, 11 Nov 2022 10:18:11 +0000 (18:18 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 17 Jan 2023 16:28:17 +0000 (17:28 +0100)
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>
drivers/usb/host/xhci.c
drivers/usb/host/xhci.h

index 79d7931c048a8cd785101adb064c2f0ea8908f2a..748c7158198f66453a2cd78a0e6b8e136a08558b 100644 (file)
@@ -5502,6 +5502,8 @@ void xhci_init_driver(struct hc_driver *drv,
                        drv->check_bandwidth = over->check_bandwidth;
                if (over->reset_bandwidth)
                        drv->reset_bandwidth = over->reset_bandwidth;
+               if (over->hub_control)
+                       drv->hub_control = over->hub_control;
        }
 }
 EXPORT_SYMBOL_GPL(xhci_init_driver);
index c9f06c5e4e9d2a7795aba70c9099e6bce937134f..f71841812f0600326d17080b4225ca885073ef58 100644 (file)
@@ -1943,6 +1943,8 @@ struct xhci_driver_overrides {
                             struct usb_host_endpoint *ep);
        int (*check_bandwidth)(struct usb_hcd *, struct usb_device *);
        void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *);
+       int (*hub_control)(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
+                          u16 wIndex, char *buf, u16 wLength);
 };
 
 #define        XHCI_CFC_DELAY          10