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-combo: 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 combo 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-10-johan+linaro@kernel.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Johan Hovold and committed by
Vinod Koul
064bbdba 69c90cb5

+6 -21
+6 -21
drivers/phy/qualcomm/phy-qcom-qmp-combo.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; ··· 2726 2729 if (cfg->pcs_usb_offset) 2727 2730 qphy->pcs_usb = qphy->pcs + cfg->pcs_usb_offset; 2728 2731 2729 - /* 2730 - * If this is a dual-lane PHY, then there should be registers for the 2731 - * second lane. Some old device trees did not specify this, so fall 2732 - * back to old legacy behavior of assuming they can be reached at an 2733 - * offset from the first lane. 2734 - */ 2735 2732 if (cfg->is_dual_lane_phy) { 2736 2733 qphy->tx2 = devm_of_iomap(dev, np, 3, NULL); 2734 + if (IS_ERR(qphy->tx2)) 2735 + return PTR_ERR(qphy->tx2); 2736 + 2737 2737 qphy->rx2 = devm_of_iomap(dev, np, 4, NULL); 2738 - if (IS_ERR(qphy->tx2) || IS_ERR(qphy->rx2)) { 2739 - dev_warn(dev, 2740 - "Underspecified device tree, falling back to legacy register regions\n"); 2738 + if (IS_ERR(qphy->rx2)) 2739 + return PTR_ERR(qphy->rx2); 2741 2740 2742 - /* In the old version, pcs_misc is at index 3. */ 2743 - qphy->pcs_misc = qphy->tx2; 2744 - qphy->tx2 = qphy->tx + QMP_PHY_LEGACY_LANE_STRIDE; 2745 - qphy->rx2 = qphy->rx + QMP_PHY_LEGACY_LANE_STRIDE; 2746 - 2747 - } else { 2748 - qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL); 2749 - } 2750 - 2741 + qphy->pcs_misc = devm_of_iomap(dev, np, 5, NULL); 2751 2742 } else { 2752 2743 qphy->pcs_misc = devm_of_iomap(dev, np, 3, NULL); 2753 2744 }