[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260105-dt-parser-v1-1-b11c63cb5e2c@oss.qualcomm.com>
Date: Mon, 05 Jan 2026 17:57:54 +0530
From: Sumit Kumar <sumit.kumar@....qualcomm.com>
To: Bjorn Helgaas <bhelgaas@...gle.com>, Jingoo Han <jingoohan1@...il.com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof WilczyĆski <kwilczynski@...nel.org>,
Manivannan Sadhasivam <mani@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk@...nel.org>,
Alim Akhtar <alim.akhtar@...sung.com>,
Richard Zhu <hongxing.zhu@....com>,
Lucas Stach <l.stach@...gutronix.de>, Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>, Yue Wang <yue.wang@...ogic.com>,
Neil Armstrong <neil.armstrong@...aro.org>,
Kevin Hilman <khilman@...libre.com>,
Jerome Brunet <jbrunet@...libre.com>,
Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Greentime Hu <greentime.hu@...ive.com>,
Samuel Holland <samuel.holland@...ive.com>,
Chuanhua Lei <lchuanhua@...linear.com>,
Marek Vasut <marek.vasut+renesas@...il.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Geert Uytterhoeven <geert+renesas@...der.be>,
Magnus Damm <magnus.damm@...il.com>,
Pratyush Anand <pratyush.anand@...il.com>,
Thierry Reding <thierry.reding@...il.com>,
Jonathan Hunter <jonathanh@...dia.com>
Cc: linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-samsung-soc@...r.kernel.org, imx@...ts.linux.dev,
linux-amlogic@...ts.infradead.org, linux-arm-msm@...r.kernel.org,
linux-renesas-soc@...r.kernel.org, linux-tegra@...r.kernel.org,
linux-riscv@...ts.infradead.org,
Sumit Kumar <sumit.kumar@....qualcomm.com>
Subject: [PATCH 1/2] PCI: API changes for multi-port controller support
For multi-port controllers, equalization preset properties should be
specified in individual root port nodes rather than the controller node,
allowing each port to have its own configuration.
Change of_pci_get_equalization_presets() to accept a device_node pointer.
This allows parsing equalization presets from any device tree node,
which is needed for multi-port PCIe controllers.
Signed-off-by: Sumit Kumar <sumit.kumar@....qualcomm.com>
---
drivers/pci/of.c | 6 ++++--
drivers/pci/pci.h | 2 ++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/of.c b/drivers/pci/of.c
index 3579265f119845637e163d9051437c89662762f8..d09eff40b523c920c9ca3eaa64f784765b3c5bf8 100644
--- a/drivers/pci/of.c
+++ b/drivers/pci/of.c
@@ -971,6 +971,7 @@ EXPORT_SYMBOL_GPL(of_pci_get_slot_power_limit);
* of_pci_get_equalization_presets - Parses the "eq-presets-Ngts" property.
*
* @dev: Device containing the properties.
+ * @node: Device tree node containing the properties.
* @presets: Pointer to store the parsed data.
* @num_lanes: Maximum number of lanes supported.
*
@@ -981,6 +982,7 @@ EXPORT_SYMBOL_GPL(of_pci_get_slot_power_limit);
* errno otherwise.
*/
int of_pci_get_equalization_presets(struct device *dev,
+ struct device_node *node,
struct pci_eq_presets *presets,
int num_lanes)
{
@@ -988,7 +990,7 @@ int of_pci_get_equalization_presets(struct device *dev,
int ret;
presets->eq_presets_8gts[0] = PCI_EQ_RESV;
- ret = of_property_read_u16_array(dev->of_node, "eq-presets-8gts",
+ ret = of_property_read_u16_array(node, "eq-presets-8gts",
presets->eq_presets_8gts, num_lanes);
if (ret && ret != -EINVAL) {
dev_err(dev, "Error reading eq-presets-8gts: %d\n", ret);
@@ -998,7 +1000,7 @@ int of_pci_get_equalization_presets(struct device *dev,
for (int i = 0; i < EQ_PRESET_TYPE_MAX - 1; i++) {
presets->eq_presets_Ngts[i][0] = PCI_EQ_RESV;
snprintf(name, sizeof(name), "eq-presets-%dgts", 8 << (i + 1));
- ret = of_property_read_u8_array(dev->of_node, name,
+ ret = of_property_read_u8_array(node, name,
presets->eq_presets_Ngts[i],
num_lanes);
if (ret && ret != -EINVAL) {
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h
index 34f65d69662e9f61f0c489ec58de2ce17d21c0c6..72fa6db95b8a75f6e69b8019d1eb2262b6a46c13 100644
--- a/drivers/pci/pci.h
+++ b/drivers/pci/pci.h
@@ -965,6 +965,7 @@ void pci_release_bus_of_node(struct pci_bus *bus);
int devm_of_pci_bridge_init(struct device *dev, struct pci_host_bridge *bridge);
bool of_pci_supply_present(struct device_node *np);
int of_pci_get_equalization_presets(struct device *dev,
+ struct device_node *node,
struct pci_eq_presets *presets,
int num_lanes);
#else
@@ -1013,6 +1014,7 @@ static inline bool of_pci_supply_present(struct device_node *np)
}
static inline int of_pci_get_equalization_presets(struct device *dev,
+ struct device_node *node,
struct pci_eq_presets *presets,
int num_lanes)
{
--
2.34.1
Powered by blists - more mailing lists