aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3/dwc3-pci.c
AgeCommit message (Collapse)AuthorFilesLines
2020-10-27usb: dwc3: pci: add support for the Intel Alder Lake-SHeikki Krogerus1-0/+4
This patch adds the necessary PCI ID for Intel Alder Lake-S devices. Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-10-02usb: dwc3: pci: Allow Elkhart Lake to utilize DSM method for PM functionalityRaymond Tan1-1/+2
Similar to some other IA platforms, Elkhart Lake too depends on the PMU register write to request transition of Dx power state. Thus, we add the PCI_DEVICE_ID_INTEL_EHLLP to the list of devices that shall execute the ACPI _DSM method during D0/D3 sequence. [[email protected]: included Fixes tag] Fixes: dbb0569de852 ("usb: dwc3: pci: Add Support for Intel Elkhart Lake Devices") Cc: [email protected] Signed-off-by: Raymond Tan <[email protected]> Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-07-20Merge 5.8-rc6 into usb-nextGreg Kroah-Hartman1-0/+8
We need the USB fixes in here as well. Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-15usb: dwc3: Replace HTTP links with HTTPS onesAlexander A. Klimov1-1/+1
Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-09usb: dwc3: pci: add support for the Intel Jasper LakeHeikki Krogerus1-0/+4
This patch adds the necessary PCI ID for Intel Jasper Lake devices. Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-07-09usb: dwc3: pci: add support for the Intel Tiger Lake PCH -H variantHeikki Krogerus1-0/+4
This patch adds the necessary PCI ID for TGP-H devices. Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-06-24usb: dwc3: pci: Fix reference count leak in dwc3_pci_resume_workAditya Pakki1-1/+3
dwc3_pci_resume_work() calls pm_runtime_get_sync() that increments the reference counter. In case of failure, decrement the reference before returning. Signed-off-by: Aditya Pakki <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-05-09usb: dwc3: pci: Enable extcon driver for Intel MerrifieldAndy Shevchenko1-0/+1
Intel Merrifield provides a DR support via PMIC which has its own extcon driver. Add a property string to link to that driver. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2020-01-22usb: dwc3: pci: add ID for the Intel Comet Lake -V variantHeikki Krogerus1-0/+4
There is one more Comet Lake PCH variant, CML-V, that has its own PCI ID. Signed-off-by: Heikki Krogerus <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-12-12usb: dwc3: pci: add ID for the Intel Comet Lake -H variantHeikki Krogerus1-1/+5
The original ID that was added for Comet Lake PCH was actually for the -LP (low power) variant even though the constant for it said CMLH. Changing that while at it. Signed-off-by: Heikki Krogerus <[email protected]> Acked-by: Felipe Balbi <[email protected]> Cc: stable <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-10-27usb: dwc3: pci: prevent memory leak in dwc3_pci_probeNavid Emamdoost1-1/+1
In dwc3_pci_probe a call to platform_device_alloc allocates a device which is correctly put in case of error except one case: when the call to platform_device_add_properties fails it directly returns instead of going to error handling. This commit replaces return with the goto. Fixes: 1a7b12f69a94 ("usb: dwc3: pci: Supply device properties via driver data") Signed-off-by: Navid Emamdoost <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2019-07-03usb: dwc3: pci: add support for TigerLake DevicesFelipe Balbi1-0/+4
This patch adds the necessary PCI ID for TGP-LP devices. Signed-off-by: Felipe Balbi <[email protected]>
2019-06-20usb: dwc3: pci: Add Support for Intel Elkhart Lake DevicesFelipe Balbi1-0/+4
This patch simply adds a new PCI Device ID Signed-off-by: Felipe Balbi <[email protected]>
2019-03-20usb: dwc3: pci: add support for Comet Lake PCH IDFelipe Balbi1-0/+4
This patch simply adds a new PCI Device ID Signed-off-by: Felipe Balbi <[email protected]>
2018-12-07Revert "usb: dwc3: pci: Use devm functions to get the phy GPIOs"Stephan Gerhold1-4/+4
Commit 211f658b7b40 ("usb: dwc3: pci: Use devm functions to get the phy GPIOs") changed the code to claim the PHY GPIOs permanently for Intel Baytrail devices. This causes issues when the actual PHY driver attempts to claim the same GPIO descriptors. For example, tusb1210 now fails to probe with: tusb1210: probe of dwc3.0.auto.ulpi failed with error -16 (EBUSY) dwc3-pci needs to turn on the PHY once before dwc3 is loaded, but usually the PHY driver will then hold the GPIOs to turn off the PHY when requested (e.g. during suspend). To fix the problem, this reverts the commit to restore the old behavior to put the GPIOs immediately after usage. Link: https://www.spinics.net/lists/linux-usb/msg174681.html Cc: [email protected] Signed-off-by: Stephan Gerhold <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-11-14usb: dwc3: Fix NULL pointer exception in dwc3_pci_remove()Kuppuswamy Sathyanarayanan1-1/+3
In dwc3_pci_quirks() function, gpiod lookup table is only registered for baytrail SOC. But in dwc3_pci_remove(), we try to unregistered it without any checks. This leads to NULL pointer de-reference exception in gpiod_remove_lookup_table() when unloading the module for non baytrail SOCs. This patch fixes this issue. Fixes: 5741022cbdf3 ("usb: dwc3: pci: Add GPIO lookup table on platforms without ACPI GPIO resources") Cc: <[email protected]> Signed-off-by: Kuppuswamy Sathyanarayanan <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-08-29usb: dwc3: pci: Fix return value check in dwc3_byt_enable_ulpi_refclock()Wei Yongjun1-2/+2
In case of error, the function pcim_iomap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 7740d04d901d ("usb: dwc3: pci: Enable ULPI Refclk on platforms where the firmware does not") Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-07-30usb: dwc3: pci: Intel Merrifield can be hostAndy Shevchenko1-1/+7
On Intel Edison board the OTG function is enabled, thus, USB can switch to the host mode. Allow that by changing dr_mode property to "otg" for Intel Merrifield. Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-07-30usb: dwc3: pci: Supply device properties via driver dataAndy Shevchenko1-57/+74
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 <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-07-30usb: dwc3: Describe 'wakeup_work' field of struct dwc3_pciAndy Shevchenko1-0/+1
Describe 'wakeup_work' field of struct dwc3_pci to avoid a warning: drivers/usb/dwc3/dwc3-pci.c:59: warning: Function parameter or member 'wakeup_work' not described in 'dwc3_pci' Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-07-26usb: dwc3: pci: Use devm functions to get the phy GPIOsHans de Goede1-4/+4
Even though we only use them once, it is better to not put/release the GPIOs immediately after use, so that others cannot claim them. Use devm functions to get the phy GPIOs, so that they will be automatically released when were unbound from the device and remove the gpio_put calls. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-07-26usb: dwc3: pci: Enable ULPI Refclk on platforms where the firmware does notHans de Goede1-0/+31
On some Bay Trail (BYT) systems the firmware does not enable the ULPI Refclk. This commit adds a helper which checks and if necessary enabled the Refclk and calls this helper for BYT machines. Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-07-26usb: dwc3: pci: Add GPIO lookup table on platforms without ACPI GPIO resourcesHans de Goede1-0/+18
Bay Trail / BYT SoCs do not have a builtin device-mode phy, instead they require an external ULPI phy for device-mode. Only some BYT devices have an external phy, but even on those devices device-mode is not working because the dwc3 does not see the phy. The problem is that the ACPI fwnode for the dwc3 does not contain the expected GPIO resources for the GPIOs connected to the chip-select and reset pins of the phy. I've found the workaround which some Android x86 kernels use for this: https://github.com/BORETS24/Kernel-for-Asus-Zenfone-2/blob/master/arch/x86/platform/intel-mid/device_libs/pci/platform_usb_otg.c Which boils down to hardcoding the GPIOs for these devices. The good news it that all boards (*) use the same GPIOs. This commit fixes the ULPI phy not woring by adding a gpiod_lookup_table call which adds a hardcoded mapping for BYT devices. Note that the mapping added by gpiod_add_lookup_table is a fallback mapping, so boards which properly provide GPIO resources in the ACPI firmware-node resources will not use this. *) Except for the first revision of the evalulation-kit, which normal users don't have Signed-off-by: Hans de Goede <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-07-26usb: dwc3: Add a glue driver for Synopsys HAPS platformThinh Nguyen1-30/+0
This driver is to be used for Synopsys PCIe-base HAPS platform. Move the the HAPS support from dwc3-pci to this driver. Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-06-18usb: dwc3: pci: add support for Intel IceLakeHeikki Krogerus1-0/+2
PCI IDs for Intel IceLake. Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2018-03-22usb: dwc3: pci: Properly cleanup resourceThinh Nguyen1-1/+1
Platform device is allocated before adding resources. Make sure to properly cleanup on error case. Cc: <[email protected]> Fixes: f1c7e7108109 ("usb: dwc3: convert to pcim_enable_device()") Signed-off-by: Thinh Nguyen <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2017-11-07USB: dwc3: Remove redundant license textGreg Kroah-Hartman1-9/+0
Now that the SPDX tag is in all USB files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Kukjin Kim <[email protected]> Cc: Krzysztof Kozlowski <[email protected]> Cc: Patrice Chotard <[email protected]> Acked-by: Felipe Balbi <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-11-04USB: add SPDX identifiers to all remaining files in drivers/usb/Greg Kroah-Hartman1-0/+1
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the drivers/usb/ and include/linux/usb* files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Thomas Gleixner <[email protected]> Cc: Kate Stewart <[email protected]> Cc: Philippe Ombredanne <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Acked-by: Felipe Balbi <[email protected]> Acked-by: Johan Hovold <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-10-24usb: dwc3: pci: Runtime resume child device from wqManu Gautam1-2/+27
Driver currently resumes and increments pm usage_count of its child device (dwc3 main) from its runtime_resume handler. This requires dwc3 runtime_resume to perform pm_runtime_put to decrement the pm usage_count. However runtime_put from dwc3 happens for non pci drivers (e.g. dwc3-if-simple.c) as well which results in dwc3 pm usage_count becoming negative after couple of runtime suspend resume iterations. Fix this by performing runtime_get/put from dwc3-pci driver only using workqueue. Signed-off-by: Manu Gautam <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2017-08-10usb/dwc3:constify dev_pm_opsDoug Wilson1-1/+1
dev_pm_ops is not supposed to change at runtime. Marking it constant. Signed-off-by: Doug Wilson <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-06-28PM / core: Drop run_wake flag from struct dev_pm_infoRafael J. Wysocki1-2/+1
The run_wake flag in struct dev_pm_info is used to indicate whether or not the device is capable of generating remote wakeup signals at run time (or in the system working state), but the distinction between runtime remote wakeup and system wakeup signaling has always been rather artificial. The only practical reason for it to exist at the core level was that ACPI and PCI treated those two cases differently, but that's not the case any more after recent changes. For this reason, get rid of the run_wake flag and, when applicable, use device_set_wakeup_capable() and device_can_wakeup() instead of device_set_run_wake() and device_run_wake(), respectively. Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Acked-by: Bjorn Helgaas <[email protected]>
2017-06-07ACPI: Switch to use generic guid_t in acpi_evaluate_dsm()Andy Shevchenko1-5/+5
acpi_evaluate_dsm() and friends take a pointer to a raw buffer of 16 bytes. Instead we convert them to use guid_t type. At the same time we convert current users. acpi_str_to_uuid() becomes useless after the conversion and it's safe to get rid of it. Acked-by: Rafael J. Wysocki <[email protected]> Cc: Borislav Petkov <[email protected]> Acked-by: Dan Williams <[email protected]> Cc: Amir Goldstein <[email protected]> Reviewed-by: Jarkko Sakkinen <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Acked-by: Jani Nikula <[email protected]> Cc: Ben Skeggs <[email protected]> Acked-by: Benjamin Tissoires <[email protected]> Acked-by: Joerg Roedel <[email protected]> Acked-by: Adrian Hunter <[email protected]> Cc: Yisen Zhuang <[email protected]> Acked-by: Bjorn Helgaas <[email protected]> Acked-by: Felipe Balbi <[email protected]> Acked-by: Mathias Nyman <[email protected]> Reviewed-by: Heikki Krogerus <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
2017-05-16usb: dwc3: pci: add Intel Cannonlake PCI IDsHeikki Krogerus1-0/+4
Intel Cannonlake PCH has the same DWC3 than Intel Sunrisepoint. Add the new IDs to the supported devices. Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2017-03-23usb: dwc3: pci: Switch to devm_acpi_dev_add_driver_gpios()Andy Shevchenko1-2/+3
Switch to use managed variant of acpi_dev_add_driver_gpios() to simplify error path and fix potentially wrong assignment if ->probe() fails. While here, add a debug message in case assignment fails to allow user see the cause of a potential issue. Signed-off-by: Andy Shevchenko <[email protected]> Acked-by: Felipe Balbi <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2017-01-02usb: dwc3: pci: add Intel Gemini Lake PCI IDHeikki Krogerus1-0/+2
Intel Gemini Lake SoC has the same DWC3 than Broxton. Add the new ID to the supported Devices. Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2017-01-02usb: dwc3: pci: Add "linux,sysdev_is_parent" propertyJohn Youn1-10/+3
Calling platform_device_add_properties() replaces existing properties so the "linux,sysdev_is_parent" property doesn't get set. Add this property to each platform. Fixes: d64ff406e51e ("usb: dwc3: use bus->sysdev for DMA configuration") Signed-off-by: John Youn <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2017-01-02usb: dwc3: pci: Fix dr_mode misspellingHans de Goede1-1/+1
usb_get_dr_mode() expects the device-property to be spelled "dr_mode" not "dr-mode". Spelling it properly fixes the following warning showing up in dmesg: [ 8704.500545] dwc3 dwc3.2.auto: Configuration mismatch. dr_mode forced to gadget Signed-off-by: Hans de Goede <[email protected] Signed-off-by: Felipe Balbi <[email protected]>
2016-11-18usb: dwc3: use bus->sysdev for DMA configurationArnd Bergmann1-0/+10
The dma ops for dwc3 devices are not set properly. So, use a physical device sysdev, which will be inherited from parent, to set the hardware / firmware parameters like dma. Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Sriram Dash <[email protected]> Tested-by: Baolin Wang <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2016-11-18usb: dwc3: pci: avoid build warningFelipe Balbi1-24/+26
dwc3_pci_dsm() is only needed if (PM || PM_SLEEP), we should make sure it's not defined if neither of those is defined. This fixes a randconfig build warning. Acked-by: Arnd Bergmann <[email protected]> Reported-by: Arnd Bergmann <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2016-11-03usb: dwc3: pci: call _DSM for suspend/resumeFelipe Balbi1-12/+61
Intel's BXT devices need to execute a _DSM method during {runtime_,}{suspend,resume} in order to get a chunk of dwc3 to power gate and save some extra power. Let's do that now. Signed-off-by: Felipe Balbi <[email protected]>
2016-11-03usb: dwc3: pci: add a private driver structureFelipe Balbi1-15/+34
We'll be tracking a little more information for PCI drivers, it's about time we add a private structure for that. Signed-off-by: Felipe Balbi <[email protected]>
2016-09-07usb: dwc3: pci: fix build warning on !PM_SLEEPFelipe Balbi1-1/+3
When building a kernel with CONFIG_PM_SLEEP=n, we get the following warning: drivers/usb/dwc3/dwc3-pci.c:253:12: warning: 'dwc3_pci_pm_dummy' defined but not used In order to fix this, we should only define dwc3_pci_pm_dummy() when CONFIG_PM_SLEEP is defined. Fixes: f6c274e11e3b ("usb: dwc3: pci: runtime_resume child device") Reported-by: Arnd Bergmann <[email protected]> Acked-by: Arnd Bergmann <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2016-08-22usb: dwc3: pci: runtime_resume child deviceFelipe Balbi1-1/+8
During runtime_resume of dwc3-pci.c, we need to runtime suspend our child device (which is dwc3 proper) otherwise nothing will happen. Signed-off-by: Felipe Balbi <[email protected]>
2016-08-10usb: dwc3: pci: add Intel Kabylake PCI IDHeikki Krogerus1-0/+2
Intel Kabylake PCH has the same DWC3 than Intel Sunrisepoint. Add the new ID to the supported devices. Cc: <[email protected]> Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2016-06-21usb: dwc3: pci: add dr-mode for Intel dwc3Felipe Balbi1-25/+37
It's know that Intel's SoCs' dwc3 integration is peripheral-only since Intel implements its own portmux for role-swapping. In order to prevent dwc3 from ever registering and XHCI platform_device, let's just set dr-mode to peripheral-only on Intel SoCs. Signed-off-by: Felipe Balbi <[email protected]>
2016-06-20usb: dwc3: pci: use build-in properties instead of platform dataHeikki Krogerus1-38/+32
This should allow the core driver to drop handling of platform data and expect the platform specific details to always come from properties. Tested-by: John Youn <[email protected]> Signed-off-by: Heikki Krogerus <[email protected]> Cc: Huang Rui <[email protected]> CC: John Youn <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2016-06-20usb: dwc3: pci: add Power Management dummy hooksFelipe Balbi1-0/+39
Allow for dwc3-pci to reach D3 and enable pm_runtime by providing dummy PM hooks. Without them, PCI subsystem won't put device to D3. Signed-off-by: Felipe Balbi <[email protected]>
2016-04-28usb: dwc3: pci: pass the platform device as a parameter to dwc3_pci_quirks()Heikki Krogerus1-8/+5
For convenience, passing the dwc3 platform device as a parameter to dwc3_pci_quirks() function. Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2016-04-28usb: dwc3: pci: make build-in device properties availableHeikki Krogerus1-3/+4
Setting the ACPI companion before calling dwc3_pci_quirks. The ACPI companion will be set unconditionally as the primary fwnode, overriding any previously set primary fwnode. This will make sure that any build-in properties added to the platform device will be added as the secondary fwnode in cases where also ACPI companion exists. Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>
2016-04-06usb: dwc3: pci: add ID for one more Intel Broxton platformHeikki Krogerus1-0/+2
BXT-M is a Intel Broxton SoC based platform with unique PCI ID. Signed-off-by: Heikki Krogerus <[email protected]> Signed-off-by: Felipe Balbi <[email protected]>