From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 15DAC1474BB; Thu, 11 Apr 2024 10:33:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712831639; cv=none; b=MCNKwVSiK/81JBYiyv/+YUPNKxbZ7N1JskjkXWOO/3GRTS/BS79Ufg82nYjxlIS6VS9j35MH7awG1OJo0RED2H/baw8xixceirfUAXECXoY0nbnuzmexZlz1OCbovxn9YF+9Acq1bCdqUQFpz0Cb9K41oAlNbulo7wi4vCE2B1I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712831639; c=relaxed/simple; bh=wWo2V9rsmi6qA+90hTS6ByHGsJKVtT6g1m+3bGbnNVM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Mq77OkdLw2kSp9B77cjQA7RhJXhU5nwB3FkFBUakBxvKHCanWYckT5hKckonL/0i/CDEgPszlA2mv/KFCrG8GyKyVXj4EC4jKXhcysPjRBJp/U/BnQRwWxiwXPcXs8tJuGwvYxvZhQQoK91NB6de4yaJmplIEPoQxd2fsPYaY8E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=y8N518mX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="y8N518mX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9460BC433F1; Thu, 11 Apr 2024 10:33:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1712831639; bh=wWo2V9rsmi6qA+90hTS6ByHGsJKVtT6g1m+3bGbnNVM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=y8N518mXIGZVy3tgXw5chn4vEVawfqeueiBh5Rew5uK6uYJh5mQbT5PUhUjXGdNxu nXibzn0V1Ar+Il0/XCIV/rlf32m1lMspY4C3WEyG397NTjkVL3lBjsAE7/NUGSVMx0 krQLYsAnmqtzx01XdZBw1sqf2I8Wu4LnUtfQfuYs= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Wayne Chang , Jon Hunter , Sasha Levin Subject: [PATCH 5.10 077/294] phy: tegra: xusb: Add API to retrieve the port number of phy Date: Thu, 11 Apr 2024 11:54:00 +0200 Message-ID: <20240411095438.006865712@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240411095435.633465671@linuxfoundation.org> References: <20240411095435.633465671@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wayne Chang [ Upstream commit d843f031d9e90462253015bc0bd9e3852d206bf2 ] 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 Reviewed-by: Jon Hunter Tested-by: Jon Hunter Link: https://lore.kernel.org/r/20240307030328.1487748-2-waynec@nvidia.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/phy/tegra/xusb.c | 13 +++++++++++++ include/linux/phy/tegra/xusb.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c index 8f11b293c48d1..856397def89ac 100644 --- a/drivers/phy/tegra/xusb.c +++ b/drivers/phy/tegra/xusb.c @@ -1399,6 +1399,19 @@ int tegra_xusb_padctl_get_usb3_companion(struct tegra_xusb_padctl *padctl, } EXPORT_SYMBOL_GPL(tegra_xusb_padctl_get_usb3_companion); +int tegra_xusb_padctl_get_port_number(struct phy *phy) +{ + struct tegra_xusb_lane *lane; + + if (!phy) + return -ENODEV; + + lane = phy_get_drvdata(phy); + + return lane->index; +} +EXPORT_SYMBOL_GPL(tegra_xusb_padctl_get_port_number); + MODULE_AUTHOR("Thierry Reding "); MODULE_DESCRIPTION("Tegra XUSB Pad Controller driver"); MODULE_LICENSE("GPL v2"); diff --git a/include/linux/phy/tegra/xusb.h b/include/linux/phy/tegra/xusb.h index 71d956935405f..86ccd90e425c7 100644 --- a/include/linux/phy/tegra/xusb.h +++ b/include/linux/phy/tegra/xusb.h @@ -23,4 +23,6 @@ int tegra_xusb_padctl_set_vbus_override(struct tegra_xusb_padctl *padctl, int tegra_phy_xusb_utmi_port_reset(struct phy *phy); int tegra_xusb_padctl_get_usb3_companion(struct tegra_xusb_padctl *padctl, unsigned int port); +int tegra_xusb_padctl_get_port_number(struct phy *phy); + #endif /* PHY_TEGRA_XUSB_H */ -- 2.43.0