Re: [PATCH v1 2/2] dwc3: Supply device properties via driver data

2018-07-26 Thread Felipe Balbi
Andy Shevchenko  writes:

> For now all PCI enumerated dwc3 devices require some properties
> to be present. This allows us to unconditionally append them and supply
> via driver_data.
>
> No functional change intended.
>
> Signed-off-by: Andy Shevchenko 

Doesn't apply. Please rebase on testing/next in a couple hours after I
push it.

checking file drivers/usb/dwc3/dwc3-pci.c
Hunk #1 succeeded at 101 with fuzz 2 (offset 33 lines).
Hunk #2 succeeded at 148 with fuzz 2 (offset 33 lines).
Hunk #3 FAILED at 146.
Hunk #4 succeeded at 210 (offset 30 lines).
Hunk #5 succeeded at 255 (offset 30 lines).
Hunk #6 FAILED at 264.
2 out of 6 hunks FAILED

-- 
balbi


signature.asc
Description: PGP signature


[PATCH v1 2/2] dwc3: Supply device properties via driver data

2018-07-20 Thread Andy Shevchenko
For now all PCI enumerated dwc3 devices require some properties
to be present. This allows us to unconditionally append them and supply
via driver_data.

No functional change intended.

Signed-off-by: Andy Shevchenko 
---
 drivers/usb/dwc3/dwc3-pci.c | 145 +++-
 1 file changed, 61 insertions(+), 84 deletions(-)

diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 3958b7ae6588..9d3fff91e1bc 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -68,52 +68,45 @@ static const struct acpi_gpio_mapping acpi_dwc3_byt_gpios[] 
= {
{ },
 };
 
+static const struct property_entry dwc3_pci_synopsys_properties[] = {
+   PROPERTY_ENTRY_BOOL("snps,usb3_lpm_capable"),
+   PROPERTY_ENTRY_BOOL("snps,has-lpm-erratum"),
+   PROPERTY_ENTRY_BOOL("snps,dis_enblslpm_quirk"),
+   PROPERTY_ENTRY_BOOL("linux,sysdev_is_parent"),
+   {}
+};
+
+static const struct property_entry dwc3_pci_intel_properties[] = {
+   PROPERTY_ENTRY_STRING("dr_mode", "peripheral"),
+   PROPERTY_ENTRY_BOOL("linux,sysdev_is_parent"),
+   {}
+};
+
+static const struct property_entry dwc3_pci_amd_properties[] = {
+   PROPERTY_ENTRY_BOOL("snps,has-lpm-erratum"),
+   PROPERTY_ENTRY_U8("snps,lpm-nyet-threshold", 0xf),
+   PROPERTY_ENTRY_BOOL("snps,u2exit_lfps_quirk"),
+   PROPERTY_ENTRY_BOOL("snps,u2ss_inp3_quirk"),
+   PROPERTY_ENTRY_BOOL("snps,req_p1p2p3_quirk"),
+   PROPERTY_ENTRY_BOOL("snps,del_p1p2p3_quirk"),
+   PROPERTY_ENTRY_BOOL("snps,del_phy_power_chg_quirk"),
+   PROPERTY_ENTRY_BOOL("snps,lfps_filter_quirk"),
+   PROPERTY_ENTRY_BOOL("snps,rx_detect_poll_quirk"),
+   PROPERTY_ENTRY_BOOL("snps,tx_de_emphasis_quirk"),
+   PROPERTY_ENTRY_U8("snps,tx_de_emphasis", 1),
+   /* FIXME these quirks should be removed when AMD NL tapes out */
+   PROPERTY_ENTRY_BOOL("snps,disable_scramble_quirk"),
+   PROPERTY_ENTRY_BOOL("snps,dis_u3_susphy_quirk"),
+   PROPERTY_ENTRY_BOOL("snps,dis_u2_susphy_quirk"),
+   PROPERTY_ENTRY_BOOL("linux,sysdev_is_parent"),
+   {}
+};
+
 static int dwc3_pci_quirks(struct dwc3_pci *dwc)
 {
-   struct platform_device  *dwc3 = dwc->dwc3;
struct pci_dev  *pdev = dwc->pci;
 
-   if (pdev->vendor == PCI_VENDOR_ID_AMD &&
-   pdev->device == PCI_DEVICE_ID_AMD_NL_USB) {
-   struct property_entry properties[] = {
-   PROPERTY_ENTRY_BOOL("snps,has-lpm-erratum"),
-   PROPERTY_ENTRY_U8("snps,lpm-nyet-threshold", 0xf),
-   PROPERTY_ENTRY_BOOL("snps,u2exit_lfps_quirk"),
-   PROPERTY_ENTRY_BOOL("snps,u2ss_inp3_quirk"),
-   PROPERTY_ENTRY_BOOL("snps,req_p1p2p3_quirk"),
-   PROPERTY_ENTRY_BOOL("snps,del_p1p2p3_quirk"),
-   PROPERTY_ENTRY_BOOL("snps,del_phy_power_chg_quirk"),
-   PROPERTY_ENTRY_BOOL("snps,lfps_filter_quirk"),
-   PROPERTY_ENTRY_BOOL("snps,rx_detect_poll_quirk"),
-   PROPERTY_ENTRY_BOOL("snps,tx_de_emphasis_quirk"),
-   PROPERTY_ENTRY_U8("snps,tx_de_emphasis", 1),
-   /*
-* FIXME these quirks should be removed when AMD NL
-* tapes out
-*/
-   PROPERTY_ENTRY_BOOL("snps,disable_scramble_quirk"),
-   PROPERTY_ENTRY_BOOL("snps,dis_u3_susphy_quirk"),
-   PROPERTY_ENTRY_BOOL("snps,dis_u2_susphy_quirk"),
-   PROPERTY_ENTRY_BOOL("linux,sysdev_is_parent"),
-   { },
-   };
-
-   return platform_device_add_properties(dwc3, properties);
-   }
-
if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
-   int ret;
-
-   struct property_entry properties[] = {
-   PROPERTY_ENTRY_STRING("dr_mode", "peripheral"),
-   PROPERTY_ENTRY_BOOL("linux,sysdev_is_parent"),
-   { }
-   };
-
-   ret = platform_device_add_properties(dwc3, properties);
-   if (ret < 0)
-   return ret;
-
if (pdev->device == PCI_DEVICE_ID_INTEL_BXT ||
pdev->device == PCI_DEVICE_ID_INTEL_BXT_M) {
guid_parse(PCI_INTEL_BXT_DSM_GUID, &dwc->guid);
@@ -122,6 +115,7 @@ static int dwc3_pci_quirks(struct dwc3_pci *dwc)
 
if (pdev->device == PCI_DEVICE_ID_INTEL_BYT) {
struct gpio_desc *gpio;
+   int ret;
 
ret = devm_acpi_dev_add_driver_gpios(&pdev->dev,
acpi_dwc3_byt_gpios);
@@ -152,21 +146,6 @@ static int dwc3_pci_quirks(struct dwc3_pci *dwc)
}
}
 
-   if (pdev->vendor