summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Hovold <johan+linaro@kernel.org>2022-09-16 13:23:37 +0300
committerVinod Koul <vkoul@kernel.org>2022-09-20 09:01:16 +0300
commit69c90cb51661290e2f49e3d4c18cbbbe56749337 (patch)
tree51c16b6ddd26b2d3b34b2961cbfe9c60c1d92e6d
parent79a03925f79e4cfada997db7af1fcd3e958c1a2a (diff)
downloadlinux-69c90cb51661290e2f49e3d4c18cbbbe56749337.tar.xz
phy: qcom-qmp-pcie: drop unused legacy DT workaround
Commit 5e17b95d9893 ("phy: qcom-qmp: Utilize fully-specified DT registers") added a workaround for legacy devicetrees which did not specify register regions for the second lane of some dual-lane PHYs. At the time, the only two dual-lane PHYs supported by mainline were "qcom,sdm845-qmp-usb3-phy" and "qcom,sdm845-qmp-ufs-phy", neither of which is a PCIe PHY. Drop the workaround for malformed devicetrees, which should no longer be needed since the QMP driver split. Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Link: https://lore.kernel.org/r/20220916102340.11520-9-johan+linaro@kernel.org Signed-off-by: Vinod Koul <vkoul@kernel.org>
-rw-r--r--drivers/phy/qualcomm/phy-qcom-qmp-pcie.c27
1 files changed, 6 insertions, 21 deletions
diff --git a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
index e6636700871c..4939edcd8cb1 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
@@ -38,9 +38,6 @@
#define PHY_INIT_COMPLETE_TIMEOUT 10000
-/* Define the assumed distance between lanes for underspecified device trees. */
-#define QMP_PHY_LEGACY_LANE_STRIDE 0x400
-
struct qmp_phy_init_tbl {
unsigned int offset;
unsigned int val;
@@ -2270,28 +2267,16 @@ static int qmp_pcie_create(struct device *dev, struct device_node *np, int id,
if (IS_ERR(qphy->pcs))
return PTR_ERR(qphy->pcs);
- /*
- * If this is a dual-lane PHY, then there should be registers for the
- * second lane. Some old device trees did not specify this, so fall
- * back to old legacy behavior of assuming they can be reached at an
- * offset from the first lane.
- */
if (cfg->is_dual_lane_phy) {
qphy->tx2 = devm_of_iomap(dev, np, 3, NULL);
- qphy->rx2 = devm_of_iomap(dev, np, 4, NULL);
- if (IS_ERR(qphy->tx2) || IS_ERR(qphy->rx2)) {
- dev_warn(dev,
- "Underspecified device tree, falling back to legacy register regions\n");
+ if (IS_ERR(qphy->tx2))
+ return PTR_ERR(qphy->tx2);
- /* In the old version, pcs_misc is at index 3. */
- qphy->pcs_misc = qphy->tx2;
- qphy->tx2 = qphy->tx + QMP_PHY_LEGACY_LANE_STRIDE;
- qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE;
-
- } else {
- qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL);
- }
+ qphy->rx2 = devm_of_iomap(dev, np, 4, NULL);
+ if (IS_ERR(qphy->rx2))
+ return PTR_ERR(qphy->rx2);
+ qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL);
} else {
qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL);
}