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: 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>

authored by

Johan Hovold and committed by
Vinod Koul
69c90cb5 79a03925

+6 -21
+6 -21
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
··· 38 38 39 39 #define PHY_INIT_COMPLETE_TIMEOUT 10000 40 40 41 - /* Define the assumed distance between lanes for underspecified device trees. */ 42 - #define QMP_PHY_LEGACY_LANE_STRIDE 0x400 43 - 44 41 struct qmp_phy_init_tbl { 45 42 unsigned int offset; 46 43 unsigned int val; ··· 2267 2270 if (IS_ERR(qphy->pcs)) 2268 2271 return PTR_ERR(qphy->pcs); 2269 2272 2270 - /* 2271 - * If this is a dual-lane PHY, then there should be registers for the 2272 - * second lane. Some old device trees did not specify this, so fall 2273 - * back to old legacy behavior of assuming they can be reached at an 2274 - * offset from the first lane. 2275 - */ 2276 2273 if (cfg->is_dual_lane_phy) { 2277 2274 qphy->tx2 = devm_of_iomap(dev, np, 3, NULL); 2275 + if (IS_ERR(qphy->tx2)) 2276 + return PTR_ERR(qphy->tx2); 2277 + 2278 2278 qphy->rx2 = devm_of_iomap(dev, np, 4, NULL); 2279 - if (IS_ERR(qphy->tx2) || IS_ERR(qphy->rx2)) { 2280 - dev_warn(dev, 2281 - "Underspecified device tree, falling back to legacy register regions\n"); 2279 + if (IS_ERR(qphy->rx2)) 2280 + return PTR_ERR(qphy->rx2); 2282 2281 2283 - /* In the old version, pcs_misc is at index 3. */ 2284 - qphy->pcs_misc = qphy->tx2; 2285 - qphy->tx2 = qphy->tx + QMP_PHY_LEGACY_LANE_STRIDE; 2286 - qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE; 2287 - 2288 - } else { 2289 - qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL); 2290 - } 2291 - 2282 + qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL); 2292 2283 } else { 2293 2284 qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL); 2294 2285 }