Re: [PATCHv2 1/2] usb: dwc3: pci: use build-in properties instead of platform data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi John,

> > @@ -114,16 +117,14 @@ static int dwc3_pci_quirks(struct pci_dev *pdev)
> >  	    (pdev->device == PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3 ||
> >  	     pdev->device == PCI_DEVICE_ID_SYNOPSYS_HAPSUSB3_AXI ||
> >  	     pdev->device == PCI_DEVICE_ID_SYNOPSYS_HAPSUSB31)) {
> > -
> > -		struct dwc3_platform_data pdata;
> > -
> > -		memset(&pdata, 0, sizeof(pdata));
> > -		pdata.usb3_lpm_capable = true;
> > -		pdata.has_lpm_erratum = true;
> > -		pdata.dis_enblslpm_quirk = true;
> > -
> > -		return platform_device_add_data(pci_get_drvdata(pdev), &pdata,
> > -						sizeof(pdata));
> > +		struct property_entry pentry[] = {
> > +			PROPERTY_ENTRY_BOOL("snps,usb3_lpm_capable"),
> > +			PROPERTY_ENTRY_BOOL("snps,has-lpm-erratum"),
> > +			PROPERTY_ENTRY_BOOL("snps,dis_enblslpm_quirk"),
> 
> I tried testing in Synopsys HAPS platform.
> 
> The properties are being set here successfully but when queried in
> core.c they all report 0.
> 
> Any ideas?

How are you testing that? I just tested those properties with
linux-next and:

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 4a0dc81..c10c8ba 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -927,6 +927,10 @@ static int dwc3_probe(struct platform_device *pdev)
        device_property_read_u32(dev, "snps,quirk-frame-length-adjustment",
                                 &fladj);
 
+       dev_info(dev, "usb3_lpm_capable %d\n", dwc->usb3_lpm_capable);
+       dev_info(dev, "has_lpm_erratum %d\n", dwc->has_lpm_erratum);
+       dev_info(dev, "dis_enblslpm_quirk %d\n", dwc->dis_enblslpm_quirk);
+
        /* default to superspeed if no maximum_speed passed */
        if (dwc->maximum_speed == USB_SPEED_UNKNOWN)
                dwc->maximum_speed = USB_SPEED_SUPER;
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index d064ba8..22cd49b 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -47,6 +47,14 @@ static const struct acpi_gpio_mapping acpi_dwc3_byt_gpios[] = {
 
 static int dwc3_pci_quirks(struct pci_dev *pdev, struct platform_device *dwc3)
 {
+       struct property_entry pentry[] = {
+               PROPERTY_ENTRY_BOOL("snps,usb3_lpm_capable"),
+               PROPERTY_ENTRY_BOOL("snps,has-lpm-erratum"),
+               PROPERTY_ENTRY_BOOL("snps,dis_enblslpm_quirk"),
+               { },
+       };
+       return platform_device_add_properties(dwc3, pentry);
+
        if (pdev->vendor == PCI_VENDOR_ID_AMD &&
            pdev->device == PCI_DEVICE_ID_AMD_NL_USB) {
                struct property_entry pentry[] = {


And I can always see
..
[   17.903179] dwc3 dwc3.0.auto: usb3_lpm_capable 1
[   17.908357] dwc3 dwc3.0.auto: has_lpm_erratum 1
[   17.913419] dwc3 dwc3.0.auto: dis_enblslpm_quirk 1
..
in my syslog.


Thanks,

-- 
heikki
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux