[PATCH 22/48] clk: qcom: gcc-sc8280xp: Use common clock controller probe data
From: Abel Vesa
Date: Wed Sep 16 2026 - 06:38:32 EST
Move the always-on branch register offsets into a critical_cbcrs array
and describe the DFS RCGs through qcom_cc_driver_data.
Delegate always-on branch and DFS initialization to the common probe
path while retaining the device-specific setup in the driver's probe.
Assisted-by: LLM
Signed-off-by: Abel Vesa <abel.vesa@xxxxxxxxxxxxxxxx>
---
drivers/clk/qcom/gcc-sc8280xp.c | 35 ++++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/drivers/clk/qcom/gcc-sc8280xp.c b/drivers/clk/qcom/gcc-sc8280xp.c
index 2ab111585d7f..7fe5ad529de0 100644
--- a/drivers/clk/qcom/gcc-sc8280xp.c
+++ b/drivers/clk/qcom/gcc-sc8280xp.c
@@ -7509,7 +7509,27 @@ static const struct regmap_config gcc_sc8280xp_regmap_config = {
.fast_io = true,
};
+static const u32 gcc_sc8280xp_critical_cbcrs[] = {
+ 0x26004, /* GCC_CAMERA_AHB_CLK */
+ 0x26020, /* GCC_CAMERA_XO_CLK */
+ 0x27004, /* GCC_DISP_AHB_CLK */
+ 0x27028, /* GCC_DISP_XO_CLK */
+ 0x71004, /* GCC_GPU_CFG_AHB_CLK */
+ 0x28004, /* GCC_VIDEO_AHB_CLK */
+ 0x28028, /* GCC_VIDEO_XO_CLK */
+ 0xbb004, /* GCC_DISP1_AHB_CLK */
+ 0xbb028, /* GCC_DISP1_XO_CLK */
+};
+
+static const struct qcom_cc_driver_data gcc_sc8280xp_driver_data = {
+ .clk_cbcrs = gcc_sc8280xp_critical_cbcrs,
+ .num_clk_cbcrs = ARRAY_SIZE(gcc_sc8280xp_critical_cbcrs),
+ .dfs_rcgs = gcc_dfs_clocks,
+ .num_dfs_rcgs = ARRAY_SIZE(gcc_dfs_clocks),
+};
+
static const struct qcom_cc_desc gcc_sc8280xp_desc = {
+ .driver_data = &gcc_sc8280xp_driver_data,
.config = &gcc_sc8280xp_regmap_config,
.clks = gcc_sc8280xp_clocks,
.num_clks = ARRAY_SIZE(gcc_sc8280xp_clocks),
@@ -7538,21 +7558,6 @@ static int gcc_sc8280xp_probe(struct platform_device *pdev)
goto err_put_rpm;
}
- /* Keep some clocks always-on */
- qcom_branch_set_clk_en(regmap, 0x26004); /* GCC_CAMERA_AHB_CLK */
- qcom_branch_set_clk_en(regmap, 0x26020); /* GCC_CAMERA_XO_CLK */
- qcom_branch_set_clk_en(regmap, 0x27004); /* GCC_DISP_AHB_CLK */
- qcom_branch_set_clk_en(regmap, 0x27028); /* GCC_DISP_XO_CLK */
- qcom_branch_set_clk_en(regmap, 0x71004); /* GCC_GPU_CFG_AHB_CLK */
- qcom_branch_set_clk_en(regmap, 0x28004); /* GCC_VIDEO_AHB_CLK */
- qcom_branch_set_clk_en(regmap, 0x28028); /* GCC_VIDEO_XO_CLK */
- qcom_branch_set_clk_en(regmap, 0xbb004); /* GCC_DISP1_AHB_CLK */
- qcom_branch_set_clk_en(regmap, 0xbb028); /* GCC_DISP1_XO_CLK */
-
- ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks, ARRAY_SIZE(gcc_dfs_clocks));
- if (ret)
- goto err_put_rpm;
-
ret = qcom_cc_really_probe(&pdev->dev, &gcc_sc8280xp_desc, regmap);
if (ret)
goto err_put_rpm;
--
2.54.0