]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
clk: qcom: clk-rpmh: Make all VRMs optional
authorAlexander Koskovich <akoskovich@pm.me>
Tue, 14 Apr 2026 17:34:28 +0000 (17:34 +0000)
committerBjorn Andersson <andersson@kernel.org>
Sun, 17 May 2026 02:49:19 +0000 (21:49 -0500)
Some VRMs aren't present on all boards, so mark them as optional. This
prevents probe failures on boards where not all VRMs are present.

This resolves an issue seen on the Nothing Phone (4a) Pro (Eliza) where
probe fails due to RPMH_RF_CLK5 not being present on the board, this is
due to this device having a slightly different PMIC configuration from
the Eliza MTP.

This matches the downstream approach of marking all VRMs as optional
and makes the previous clka_optional handling redundant.

Signed-off-by: Alexander Koskovich <akoskovich@pm.me>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20260414-clk-rpmh-vrm-opt-v3-1-8ca21469ffbc@pm.me
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
drivers/clk/qcom/clk-rpmh.c

index 8eae6fccc12700fa0cae3989c25f6b3218499734..6367b2a5a4e08001051dcd7b41a4b1c29df67af5 100644 (file)
@@ -66,8 +66,6 @@ struct clk_rpmh {
 struct clk_rpmh_desc {
        struct clk_hw **clks;
        size_t num_clks;
-       /* RPMh clock clkaN are optional for this platform */
-       bool clka_optional;
 };
 
 static DEFINE_MUTEX(rpmh_clk_lock);
@@ -699,7 +697,6 @@ static struct clk_hw *sm8550_rpmh_clocks[] = {
 static const struct clk_rpmh_desc clk_rpmh_sm8550 = {
        .clks = sm8550_rpmh_clocks,
        .num_clks = ARRAY_SIZE(sm8550_rpmh_clocks),
-       .clka_optional = true,
 };
 
 static struct clk_hw *sm8650_rpmh_clocks[] = {
@@ -731,7 +728,6 @@ static struct clk_hw *sm8650_rpmh_clocks[] = {
 static const struct clk_rpmh_desc clk_rpmh_sm8650 = {
        .clks = sm8650_rpmh_clocks,
        .num_clks = ARRAY_SIZE(sm8650_rpmh_clocks),
-       .clka_optional = true,
 };
 
 static struct clk_hw *sc7280_rpmh_clocks[] = {
@@ -901,7 +897,6 @@ static struct clk_hw *sm8750_rpmh_clocks[] = {
 static const struct clk_rpmh_desc clk_rpmh_sm8750 = {
        .clks = sm8750_rpmh_clocks,
        .num_clks = ARRAY_SIZE(sm8750_rpmh_clocks),
-       .clka_optional = true,
 };
 
 static struct clk_hw *glymur_rpmh_clocks[] = {
@@ -1059,8 +1054,7 @@ static int clk_rpmh_probe(struct platform_device *pdev)
                if (!res_addr) {
                        hw_clks[i] = NULL;
 
-                       if (desc->clka_optional &&
-                           !strncmp(rpmh_clk->res_name, "clka", sizeof("clka") - 1))
+                       if (rpmh_clk->res_addr == CLK_RPMH_VRM_EN_OFFSET)
                                continue;
 
                        dev_err(&pdev->dev, "missing RPMh resource address for %s\n",