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: edp: Make the number of clocks flexible

On X Elite, the DP PHY needs another clock called ref, while all other
platforms do not.

The current X Elite devices supported upstream work fine without this
clock, because the boot firmware leaves this clock enabled. But we should
not rely on that. Also, even though this change breaks the ABI, it is
needed in order to make the driver disables this clock along with the
other ones, for a proper bring-down of the entire PHY.

So in order to handle these clocks on different platforms, make the driver
get all the clocks regardless of how many there are provided.

Cc: stable@vger.kernel.org # v6.10
Fixes: db83c107dc29 ("phy: qcom: edp: Add v6 specific ops and X1E80100 platform support")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
Link: https://patch.msgid.link/20251224-phy-qcom-edp-add-missing-refclk-v5-2-3f45d349b5ac@oss.qualcomm.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Abel Vesa and committed by
Vinod Koul
7d51b709 6b99eeac

+8 -8
+8 -8
drivers/phy/qualcomm/phy-qcom-edp.c
··· 103 103 104 104 struct phy_configure_opts_dp dp_opts; 105 105 106 - struct clk_bulk_data clks[2]; 106 + struct clk_bulk_data *clks; 107 + int num_clks; 108 + 107 109 struct regulator_bulk_data supplies[2]; 108 110 109 111 bool is_edp; ··· 220 218 if (ret) 221 219 return ret; 222 220 223 - ret = clk_bulk_prepare_enable(ARRAY_SIZE(edp->clks), edp->clks); 221 + ret = clk_bulk_prepare_enable(edp->num_clks, edp->clks); 224 222 if (ret) 225 223 goto out_disable_supplies; 226 224 ··· 887 885 { 888 886 struct qcom_edp *edp = phy_get_drvdata(phy); 889 887 890 - clk_bulk_disable_unprepare(ARRAY_SIZE(edp->clks), edp->clks); 888 + clk_bulk_disable_unprepare(edp->num_clks, edp->clks); 891 889 regulator_bulk_disable(ARRAY_SIZE(edp->supplies), edp->supplies); 892 890 893 891 return 0; ··· 1094 1092 if (IS_ERR(edp->pll)) 1095 1093 return PTR_ERR(edp->pll); 1096 1094 1097 - edp->clks[0].id = "aux"; 1098 - edp->clks[1].id = "cfg_ahb"; 1099 - ret = devm_clk_bulk_get(dev, ARRAY_SIZE(edp->clks), edp->clks); 1100 - if (ret) 1101 - return ret; 1095 + edp->num_clks = devm_clk_bulk_get_all(dev, &edp->clks); 1096 + if (edp->num_clks < 0) 1097 + return dev_err_probe(dev, edp->num_clks, "failed to get clocks\n"); 1102 1098 1103 1099 edp->supplies[0].supply = "vdda-phy"; 1104 1100 edp->supplies[1].supply = "vdda-pll";