All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 1/3] phy: qcom-qmp-pcie: make pipe clock rate configurable
@ 2022-06-21 19:55 ` Robert Marko
  0 siblings, 0 replies; 10+ messages in thread
From: Robert Marko @ 2022-06-21 19:55 UTC (permalink / raw)
  To: agross, bjorn.andersson, kishon, vkoul, robh+dt,
	krzysztof.kozlowski+dt, linux-arm-msm, linux-phy, devicetree,
	linux-kernel, dmitry.baryshkov
  Cc: Robert Marko

IPQ8074 Gen3 PCIe PHY uses 250MHz as the pipe clock rate instead of 125MHz
like every other PCIe QMP PHY does, so make it configurable as part of the
qmp_phy_cfg.

Signed-off-by: Robert Marko <robimarko@gmail.com>
---
Changes in v4:
* Set 125MHz as the default if not set in qmp_phy_cfg
---
 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
index b2cd0cf965d8..66be854fe7f3 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
@@ -1284,6 +1284,9 @@ struct qmp_phy_cfg {
 
 	/* true, if PHY has secondary tx/rx lanes to be configured */
 	bool is_dual_lane_phy;
+
+	/* QMP PHY pipe clock interface rate */
+	unsigned long pipe_clock_rate;
 };
 
 /**
@@ -2121,8 +2124,15 @@ static int phy_pipe_clk_register(struct qcom_qmp *qmp, struct device_node *np)
 
 	init.ops = &clk_fixed_rate_ops;
 
-	/* controllers using QMP phys use 125MHz pipe clock interface */
-	fixed->fixed_rate = 125000000;
+	/*
+	 * Controllers using QMP PHY-s use 125MHz pipe clock interface
+	 * unless other frequency is specified in the PHY config.
+	 */
+	if (qmp->phys[0]->cfg->pipe_clock_rate)
+		fixed->fixed_rate = qmp->phys[0]->cfg->pipe_clock_rate;
+	else
+		fixed->fixed_rate = 125000000;
+
 	fixed->hw.init = &init;
 
 	ret = devm_clk_hw_register(qmp->dev, &fixed->hw);
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-07-05  7:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-21 19:55 [PATCH v4 1/3] phy: qcom-qmp-pcie: make pipe clock rate configurable Robert Marko
2022-06-21 19:55 ` Robert Marko
2022-06-21 19:55 ` [PATCH v4 2/3] dt-bindings: phy: qcom,qmp: add IPQ8074 PCIe Gen3 PHY binding Robert Marko
2022-06-21 19:55   ` Robert Marko
2022-06-21 19:55 ` [PATCH v4 3/3] phy: qcom-qmp-pcie: add IPQ8074 PCIe Gen3 QMP PHY support Robert Marko
2022-06-21 19:55   ` Robert Marko
2022-06-21 20:16 ` [PATCH v4 1/3] phy: qcom-qmp-pcie: make pipe clock rate configurable Dmitry Baryshkov
2022-06-21 20:16   ` Dmitry Baryshkov
2022-07-05  7:26 ` Vinod Koul
2022-07-05  7:26   ` Vinod Koul

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.