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-usb: drop 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" and they had
been added to the binding less than six months before the binding was
fixed.

Presumably no one is using four-year old SDM845 dtbs with mainline
anymore so drop the workaround for malformed devicetrees. In the
unlikely event that anyone complains, we can consider reverting.

Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://lore.kernel.org/r/20220916102340.11520-12-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Johan Hovold and committed by
Vinod Koul
264dac74 63825558

+6 -21
+6 -21
drivers/phy/qualcomm/phy-qcom-qmp-usb.c
··· 66 66 #define POWER_DOWN_DELAY_US_MIN 10 67 67 #define POWER_DOWN_DELAY_US_MAX 11 68 68 69 - /* Define the assumed distance between lanes for underspecified device trees. */ 70 - #define QMP_PHY_LEGACY_LANE_STRIDE 0x400 71 - 72 69 struct qmp_phy_init_tbl { 73 70 unsigned int offset; 74 71 unsigned int val; ··· 2664 2667 if (cfg->pcs_usb_offset) 2665 2668 qphy->pcs_usb = qphy->pcs + cfg->pcs_usb_offset; 2666 2669 2667 - /* 2668 - * If this is a dual-lane PHY, then there should be registers for the 2669 - * second lane. Some old device trees did not specify this, so fall 2670 - * back to old legacy behavior of assuming they can be reached at an 2671 - * offset from the first lane. 2672 - */ 2673 2670 if (cfg->is_dual_lane_phy) { 2674 2671 qphy->tx2 = devm_of_iomap(dev, np, 3, NULL); 2672 + if (IS_ERR(qphy->tx2)) 2673 + return PTR_ERR(qphy->tx2); 2674 + 2675 2675 qphy->rx2 = devm_of_iomap(dev, np, 4, NULL); 2676 - if (IS_ERR(qphy->tx2) || IS_ERR(qphy->rx2)) { 2677 - dev_warn(dev, 2678 - "Underspecified device tree, falling back to legacy register regions\n"); 2676 + if (IS_ERR(qphy->rx2)) 2677 + return PTR_ERR(qphy->rx2); 2679 2678 2680 - /* In the old version, pcs_misc is at index 3. */ 2681 - qphy->pcs_misc = qphy->tx2; 2682 - qphy->tx2 = qphy->tx + QMP_PHY_LEGACY_LANE_STRIDE; 2683 - qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE; 2684 - 2685 - } else { 2686 - qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL); 2687 - } 2688 - 2679 + qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL); 2689 2680 } else { 2690 2681 qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL); 2691 2682 }