diff options
author | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-06-07 12:49:52 +0300 |
---|---|---|
committer | Felipe Balbi <felipe.balbi@linux.intel.com> | 2016-06-21 10:38:42 +0300 |
commit | e6fe66fe08cdf9c5d0eb6a6e209621f74f7ee60b (patch) | |
tree | d24c7e98f56caa7ba8172223556edeb7bba9bce2 /drivers/usb/dwc3/dwc3-pci.c | |
parent | 21e64bf20df5e120b37c403b46395d4f0c5d8e86 (diff) | |
download | linux-e6fe66fe08cdf9c5d0eb6a6e209621f74f7ee60b.tar.xz |
usb: dwc3: pci: add dr-mode for Intel dwc3
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 <felipe.balbi@linux.intel.com>
Diffstat (limited to 'drivers/usb/dwc3/dwc3-pci.c')
-rw-r--r-- | drivers/usb/dwc3/dwc3-pci.c | 62 |
1 files changed, 37 insertions, 25 deletions
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c index 6bc4c2b08ac7..45f5a232d9fb 100644 --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@ -76,33 +76,45 @@ static int dwc3_pci_quirks(struct pci_dev *pdev, struct platform_device *dwc3) return platform_device_add_properties(dwc3, properties); } - if (pdev->vendor == PCI_VENDOR_ID_INTEL && - pdev->device == PCI_DEVICE_ID_INTEL_BYT) { - struct gpio_desc *gpio; - - acpi_dev_add_driver_gpios(ACPI_COMPANION(&pdev->dev), - acpi_dwc3_byt_gpios); - - /* - * These GPIOs will turn on the USB2 PHY. Note that we have to - * put the gpio descriptors again here because the phy driver - * might want to grab them, too. - */ - gpio = gpiod_get_optional(&pdev->dev, "cs", GPIOD_OUT_LOW); - if (IS_ERR(gpio)) - return PTR_ERR(gpio); - - gpiod_set_value_cansleep(gpio, 1); - gpiod_put(gpio); - - gpio = gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW); - if (IS_ERR(gpio)) - return PTR_ERR(gpio); - - if (gpio) { + if (pdev->vendor == PCI_VENDOR_ID_INTEL) { + int ret; + + struct property_entry properties[] = { + PROPERTY_ENTRY_STRING("dr-mode", "peripheral"), + { } + }; + + ret = platform_device_add_properties(dwc3, properties); + if (ret < 0) + return ret; + + if (pdev->device == PCI_DEVICE_ID_INTEL_BYT) { + struct gpio_desc *gpio; + + acpi_dev_add_driver_gpios(ACPI_COMPANION(&pdev->dev), + acpi_dwc3_byt_gpios); + + /* + * These GPIOs will turn on the USB2 PHY. Note that we have to + * put the gpio descriptors again here because the phy driver + * might want to grab them, too. + */ + gpio = gpiod_get_optional(&pdev->dev, "cs", GPIOD_OUT_LOW); + if (IS_ERR(gpio)) + return PTR_ERR(gpio); + gpiod_set_value_cansleep(gpio, 1); gpiod_put(gpio); - usleep_range(10000, 11000); + + gpio = gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW); + if (IS_ERR(gpio)) + return PTR_ERR(gpio); + + if (gpio) { + gpiod_set_value_cansleep(gpio, 1); + gpiod_put(gpio); + usleep_range(10000, 11000); + } } } |