]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
usb: dwc3: pci: Add GPIO lookup table on platforms without ACPI GPIO resources
authorHans de Goede <hdegoede@redhat.com>
Sun, 10 Jun 2018 14:01:20 +0000 (16:01 +0200)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 26 Jul 2018 10:54:15 +0000 (13:54 +0300)
commit5741022cbdf3616a9def13b15ab5667a36c65706
tree05f7be4d5b79a5c0340f3112436bfc504bcf8134
parentee9a4ae7dcf19bfe13eb7ae5696ea0405de1f089
usb: dwc3: pci: Add GPIO lookup table on platforms without ACPI GPIO resources

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 <hdegoede@redhat.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/dwc3-pci.c