diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index b773fb5..b02b782 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@ -31,8 +31,41 @@ #define PCI_DEVICE_ID_INTEL_SPTLP 0x9d30 #define PCI_DEVICE_ID_INTEL_SPTH 0xa130 +static struct property_entry dwc3_pci_prop[5]; +static struct property_set dwc3_pci_pset = { + .properties = dwc3_pci_prop, +}; + +static u8 lpm_nyet_threshold[2]; +static u8 tx_de_emphasis[2]; + static int dwc3_pci_quirks(struct pci_dev *pdev) { + if (pdev->vendor == PCI_VENDOR_ID_INTEL && + pdev->device == PCI_DEVICE_ID_INTEL_SPTLP) { + struct platform_device *dwc3 = pci_get_drvdata(pdev); + + /* Let's test a couple of boolean properties */ + dwc3_pci_prop[0].name = "snps,dis_u3_susphy_quirk"; + dwc3_pci_prop[1].name = "snps,dis_u2_susphy_quirk"; + + /* And properties of type u8 */ + lpm_nyet_threshold[0] = 0xf; + tx_de_emphasis[0] = 1; + + dwc3_pci_prop[2].name = "snps,lpm-nyet-threshold"; + dwc3_pci_prop[2].type = DEV_PROP_U8; + dwc3_pci_prop[2].nval = 1; + dwc3_pci_prop[2].value.u8_data = lpm_nyet_threshold; + + dwc3_pci_prop[3].name = "snps,tx_de_emphasis"; + dwc3_pci_prop[3].type = DEV_PROP_U8; + dwc3_pci_prop[3].nval = 1; + dwc3_pci_prop[3].value.u8_data = tx_de_emphasis; + + device_add_property_set(&dwc3->dev, &dwc3_pci_pset); + } + if (pdev->vendor == PCI_VENDOR_ID_AMD && pdev->device == PCI_DEVICE_ID_AMD_NL_USB) { struct dwc3_platform_data pdata;