[PATCH 14/48] clk: qcom: dispcc0-sa8775p: Use common probe handling for always-on clocks

From: Abel Vesa

Date: Wed Sep 16 2026 - 06:48:57 EST


Describe the always-on branches in a critical_cbcrs array and reference
it through qcom_cc_driver_data. Let qcom_cc_really_probe() enable these
branches instead of programming them directly in the driver's probe.

Assisted-by: LLM
Signed-off-by: Abel Vesa <abel.vesa@xxxxxxxxxxxxxxxx>
---
drivers/clk/qcom/dispcc0-sa8775p.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/qcom/dispcc0-sa8775p.c b/drivers/clk/qcom/dispcc0-sa8775p.c
index 0e976442834a..a1861cc8343e 100644
--- a/drivers/clk/qcom/dispcc0-sa8775p.c
+++ b/drivers/clk/qcom/dispcc0-sa8775p.c
@@ -1414,7 +1414,18 @@ static const struct regmap_config disp_cc_0_sa8775p_regmap_config = {
.fast_io = true,
};

+static const u32 disp_cc_0_sa8775p_critical_cbcrs[] = {
+ 0xc070, /* MDSS_0_DISP_CC_SLEEP_CLK */
+ 0xc054, /* MDSS_0_DISP_CC_XO_CLK */
+};
+
+static const struct qcom_cc_driver_data disp_cc_0_sa8775p_driver_data = {
+ .clk_cbcrs = disp_cc_0_sa8775p_critical_cbcrs,
+ .num_clk_cbcrs = ARRAY_SIZE(disp_cc_0_sa8775p_critical_cbcrs),
+};
+
static const struct qcom_cc_desc disp_cc_0_sa8775p_desc = {
+ .driver_data = &disp_cc_0_sa8775p_driver_data,
.config = &disp_cc_0_sa8775p_regmap_config,
.clks = disp_cc_0_sa8775p_clocks,
.num_clks = ARRAY_SIZE(disp_cc_0_sa8775p_clocks),
@@ -1452,10 +1463,6 @@ static int disp_cc_0_sa8775p_probe(struct platform_device *pdev)
clk_lucid_evo_pll_configure(&mdss_0_disp_cc_pll0, regmap, &mdss_0_disp_cc_pll0_config);
clk_lucid_evo_pll_configure(&mdss_0_disp_cc_pll1, regmap, &mdss_0_disp_cc_pll1_config);

- /* Keep some clocks always enabled */
- qcom_branch_set_clk_en(regmap, 0xc070); /* MDSS_0_DISP_CC_SLEEP_CLK */
- qcom_branch_set_clk_en(regmap, 0xc054); /* MDSS_0_DISP_CC_XO_CLK */
-
ret = qcom_cc_really_probe(&pdev->dev, &disp_cc_0_sa8775p_desc, regmap);

pm_runtime_put(&pdev->dev);

--
2.54.0