From: Parth Pancholi Date: Tue, 29 Oct 2024 07:24:44 +0000 (+0100) Subject: USB: xhci: add support for PWRON active high X-Git-Tag: v6.13-rc1~31^2~80 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c74c2cc7b760905f069bfb35d8844d7ced85587a;p=thirdparty%2Fkernel%2Flinux.git USB: xhci: add support for PWRON active high Some PCIe-to-USB controllers such as TI's TUSB73x0 3.0 xHCI host controller supports controlling the PWRONx polarity via the USB control register (E0h). Add support for device tree property ti,pwron-active-high which indicates PWRONx to be active high and configure the E0h register accordingly. This enables the software control for the TUSB73x0's PWRONx outputs with an inverted polarity from the default configuration which could be used as USB EN signals for the other hubs or devices. Signed-off-by: Parth Pancholi Signed-off-by: Francesco Dolcini Link: https://lore.kernel.org/r/20241029072444.8827-3-francesco@dolcini.it Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c index 7e538194a0a4e..caafec46cc94a 100644 --- a/drivers/usb/host/xhci-pci.c +++ b/drivers/usb/host/xhci-pci.c @@ -646,6 +646,9 @@ int xhci_pci_common_probe(struct pci_dev *dev, const struct pci_device_id *id) dma_set_max_seg_size(&dev->dev, UINT_MAX); + if (device_property_read_bool(&dev->dev, "ti,pwron-active-high")) + pci_clear_and_set_config_dword(dev, 0xE0, 0, 1 << 22); + return 0; put_usb3_hcd: