diff options
author | Nagarjuna Kristam <nkristam@nvidia.com> | 2020-02-10 13:41:31 +0530 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2020-03-19 13:59:46 +0100 |
commit | 5a40fc4b934c1d1026bc401b1def8b6455ce20f0 (patch) | |
tree | a431304aa3b69ba3396a97b3bfd58dbeec98eec3 /drivers/phy/tegra | |
parent | e8f7d2f409a15c519d5a6085777d85c1c4bab73a (diff) | |
download | linux-stable-5a40fc4b934c1d1026bc401b1def8b6455ce20f0.tar.gz linux-stable-5a40fc4b934c1d1026bc401b1def8b6455ce20f0.tar.bz2 linux-stable-5a40fc4b934c1d1026bc401b1def8b6455ce20f0.zip |
phy: tegra: xusb: Add support to get companion USB 3 port
Tegra XUSB host, device mode driver requires the USB 3 companion port
number for corresponding USB 2 port. Add API to retrieve the same.
Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: JC Kuo <jckuo@nvidia.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/phy/tegra')
-rw-r--r-- | drivers/phy/tegra/xusb.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c index c36d168061a1..bfca2660d676 100644 --- a/drivers/phy/tegra/xusb.c +++ b/drivers/phy/tegra/xusb.c @@ -1299,6 +1299,27 @@ int tegra_phy_xusb_utmi_port_reset(struct phy *phy) } EXPORT_SYMBOL_GPL(tegra_phy_xusb_utmi_port_reset); +int tegra_xusb_padctl_get_usb3_companion(struct tegra_xusb_padctl *padctl, + unsigned int port) +{ + struct tegra_xusb_usb2_port *usb2; + struct tegra_xusb_usb3_port *usb3; + int i; + + usb2 = tegra_xusb_find_usb2_port(padctl, port); + if (!usb2) + return -EINVAL; + + for (i = 0; i < padctl->soc->ports.usb3.count; i++) { + usb3 = tegra_xusb_find_usb3_port(padctl, i); + if (usb3 && usb3->port == usb2->base.index) + return usb3->base.index; + } + + return -ENODEV; +} +EXPORT_SYMBOL_GPL(tegra_xusb_padctl_get_usb3_companion); + MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>"); MODULE_DESCRIPTION("Tegra XUSB Pad Controller driver"); MODULE_LICENSE("GPL v2"); |