Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

phy: tegra: xusb: Add API to retrieve the port number of phy

This patch introduces a new API, tegra_xusb_padctl_get_port_number,
to the Tegra XUSB Pad Controller driver. This API is used to identify
the USB port that is associated with a given PHY.

The function takes a PHY pointer for either a USB2 PHY or USB3 PHY as input
and returns the corresponding port number. If the PHY pointer is invalid,
it returns -ENODEV.

Cc: stable@vger.kernel.org
Signed-off-by: Wayne Chang <waynec@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Link: https://lore.kernel.org/r/20240307030328.1487748-2-waynec@nvidia.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Wayne Chang and committed by
Greg Kroah-Hartman
d843f031 07cb1ec0

+14
+13
drivers/phy/tegra/xusb.c
··· 1531 1531 } 1532 1532 EXPORT_SYMBOL_GPL(tegra_xusb_padctl_get_usb3_companion); 1533 1533 1534 + int tegra_xusb_padctl_get_port_number(struct phy *phy) 1535 + { 1536 + struct tegra_xusb_lane *lane; 1537 + 1538 + if (!phy) 1539 + return -ENODEV; 1540 + 1541 + lane = phy_get_drvdata(phy); 1542 + 1543 + return lane->index; 1544 + } 1545 + EXPORT_SYMBOL_GPL(tegra_xusb_padctl_get_port_number); 1546 + 1534 1547 MODULE_AUTHOR("Thierry Reding <treding@nvidia.com>"); 1535 1548 MODULE_DESCRIPTION("Tegra XUSB Pad Controller driver"); 1536 1549 MODULE_LICENSE("GPL v2");
+1
include/linux/phy/tegra/xusb.h
··· 26 26 int tegra_phy_xusb_utmi_port_reset(struct phy *phy); 27 27 int tegra_xusb_padctl_get_usb3_companion(struct tegra_xusb_padctl *padctl, 28 28 unsigned int port); 29 + int tegra_xusb_padctl_get_port_number(struct phy *phy); 29 30 int tegra_xusb_padctl_enable_phy_sleepwalk(struct tegra_xusb_padctl *padctl, struct phy *phy, 30 31 enum usb_device_speed speed); 31 32 int tegra_xusb_padctl_disable_phy_sleepwalk(struct tegra_xusb_padctl *padctl, struct phy *phy);