--- zzzz-none-000/linux-5.15.111/drivers/usb/host/xhci-hub.c 2023-05-11 14:00:40.000000000 +0000 +++ puma7-atom-6670-761/linux-5.15.111/drivers/usb/host/xhci-hub.c 2024-02-07 10:23:22.000000000 +0000 @@ -16,6 +16,11 @@ #include "xhci.h" #include "xhci-trace.h" +#if defined (CONFIG_AVM_KERNEL) +/* 20160219 AVM/VGJ USB3 ports switchable */ +extern int usb3port_config; +#endif + #define PORT_WAKE_BITS (PORT_WKOC_E | PORT_WKDISC_E | PORT_WKCONN_E) #define PORT_RWC_BITS (PORT_CSC | PORT_PEC | PORT_WRC | PORT_OCC | \ PORT_RC | PORT_PLC | PORT_PE) @@ -1474,6 +1479,17 @@ * However, hub_wq will ignore the roothub events until * the roothub is registered. */ +#if defined (CONFIG_AVM_KERNEL) + { + /* 20170911 AVM/VGJ USB3 ports switchable - only ports 2 and 3 are relevant */ + const int port_bit = (wIndex < 3) ? wIndex : 0; + /* 20180719 AVM/VGJ make sure selected USB3 ports are enabled */ + if ((hcd->speed == HCD_USB3) && (usb3port_config & port_bit)) { + xhci_warn(xhci, "AVM: enable USB3 bus#%d port#%d config=%x temp=%x\n", hcd->self.busnum, wIndex, usb3port_config, temp); + xhci_set_link_state(xhci, ports[wIndex], USB_SS_PORT_LS_RX_DETECT); + } + } +#endif xhci_set_port_power(xhci, hcd, wIndex, true, &flags); break; case USB_PORT_FEAT_RESET: