Commit e6fe66fe authored by Felipe Balbi's avatar Felipe Balbi

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: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 21e64bf2
...@@ -76,33 +76,45 @@ static int dwc3_pci_quirks(struct pci_dev *pdev, struct platform_device *dwc3) ...@@ -76,33 +76,45 @@ static int dwc3_pci_quirks(struct pci_dev *pdev, struct platform_device *dwc3)
return platform_device_add_properties(dwc3, properties); return platform_device_add_properties(dwc3, properties);
} }
if (pdev->vendor == PCI_VENDOR_ID_INTEL && if (pdev->vendor == PCI_VENDOR_ID_INTEL) {
pdev->device == PCI_DEVICE_ID_INTEL_BYT) { int ret;
struct gpio_desc *gpio;
struct property_entry properties[] = {
acpi_dev_add_driver_gpios(ACPI_COMPANION(&pdev->dev), PROPERTY_ENTRY_STRING("dr-mode", "peripheral"),
acpi_dwc3_byt_gpios); { }
};
/*
* These GPIOs will turn on the USB2 PHY. Note that we have to ret = platform_device_add_properties(dwc3, properties);
* put the gpio descriptors again here because the phy driver if (ret < 0)
* might want to grab them, too. return ret;
*/
gpio = gpiod_get_optional(&pdev->dev, "cs", GPIOD_OUT_LOW); if (pdev->device == PCI_DEVICE_ID_INTEL_BYT) {
if (IS_ERR(gpio)) struct gpio_desc *gpio;
return PTR_ERR(gpio);
acpi_dev_add_driver_gpios(ACPI_COMPANION(&pdev->dev),
gpiod_set_value_cansleep(gpio, 1); acpi_dwc3_byt_gpios);
gpiod_put(gpio);
/*
gpio = gpiod_get_optional(&pdev->dev, "reset", GPIOD_OUT_LOW); * These GPIOs will turn on the USB2 PHY. Note that we have to
if (IS_ERR(gpio)) * put the gpio descriptors again here because the phy driver
return PTR_ERR(gpio); * might want to grab them, too.
*/
if (gpio) { 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_set_value_cansleep(gpio, 1);
gpiod_put(gpio); 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);
}
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment