[PATCH 27/48] clk: qcom: gcc-sm6375: Use common clock controller probe data
From: Abel Vesa
Date: Wed Sep 16 2026 - 07:18:32 EST
Move the always-on branch register offsets into a critical_cbcrs array
and describe the DFS RCGs through qcom_cc_driver_data.
Move the configuration of GPLL10, GPLL11, GPLL8 and GPLL9 into the
clk_regs_configure callback. This preserves the existing ordering of
enabling the always-on branches before configuring these four PLLs.
Using the alpha_plls array instead would configure the PLLs before the
CBCR enables in the common probe path.
Use qcom_cc_probe() to perform the common initialization instead of
open-coding it in the driver's probe.
Assisted-by: LLM
Signed-off-by: Abel Vesa <abel.vesa@xxxxxxxxxxxxxxxx>
---
drivers/clk/qcom/gcc-sm6375.c | 46 ++++++++++++++++++++++---------------------
1 file changed, 24 insertions(+), 22 deletions(-)
diff --git a/drivers/clk/qcom/gcc-sm6375.c b/drivers/clk/qcom/gcc-sm6375.c
index f47dc2808095..d125243ac6cb 100644
--- a/drivers/clk/qcom/gcc-sm6375.c
+++ b/drivers/clk/qcom/gcc-sm6375.c
@@ -3853,7 +3853,30 @@ static const struct regmap_config gcc_sm6375_regmap_config = {
.fast_io = true,
};
+static const u32 gcc_sm6375_critical_cbcrs[] = {
+ 0x17028, /* GCC_CAMERA_XO_CLK */
+ 0x2b004, /* GCC_CPUSS_GNOC_CLK */
+ 0x1702c, /* GCC_DISP_XO_CLK */
+};
+
+static void gcc_sm6375_regs_configure(struct device *dev, struct regmap *regmap)
+{
+ clk_lucid_pll_configure(&gpll10, regmap, &gpll10_config);
+ clk_lucid_pll_configure(&gpll11, regmap, &gpll11_config);
+ clk_lucid_pll_configure(&gpll8, regmap, &gpll8_config);
+ clk_zonda_pll_configure(&gpll9, regmap, &gpll9_config);
+}
+
+static const struct qcom_cc_driver_data gcc_sm6375_driver_data = {
+ .clk_cbcrs = gcc_sm6375_critical_cbcrs,
+ .num_clk_cbcrs = ARRAY_SIZE(gcc_sm6375_critical_cbcrs),
+ .dfs_rcgs = gcc_dfs_clocks,
+ .num_dfs_rcgs = ARRAY_SIZE(gcc_dfs_clocks),
+ .clk_regs_configure = gcc_sm6375_regs_configure,
+};
+
static const struct qcom_cc_desc gcc_sm6375_desc = {
+ .driver_data = &gcc_sm6375_driver_data,
.config = &gcc_sm6375_regmap_config,
.clks = gcc_sm6375_clocks,
.num_clks = ARRAY_SIZE(gcc_sm6375_clocks),
@@ -3871,28 +3894,7 @@ MODULE_DEVICE_TABLE(of, gcc_sm6375_match_table);
static int gcc_sm6375_probe(struct platform_device *pdev)
{
- struct regmap *regmap;
- int ret;
-
- regmap = qcom_cc_map(pdev, &gcc_sm6375_desc);
- if (IS_ERR(regmap))
- return PTR_ERR(regmap);
-
- ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks, ARRAY_SIZE(gcc_dfs_clocks));
- if (ret)
- return ret;
-
- /* Keep some clocks always-on */
- qcom_branch_set_clk_en(regmap, 0x17028); /* GCC_CAMERA_XO_CLK */
- qcom_branch_set_clk_en(regmap, 0x2b004); /* GCC_CPUSS_GNOC_CLK */
- qcom_branch_set_clk_en(regmap, 0x1702c); /* GCC_DISP_XO_CLK */
-
- clk_lucid_pll_configure(&gpll10, regmap, &gpll10_config);
- clk_lucid_pll_configure(&gpll11, regmap, &gpll11_config);
- clk_lucid_pll_configure(&gpll8, regmap, &gpll8_config);
- clk_zonda_pll_configure(&gpll9, regmap, &gpll9_config);
-
- return qcom_cc_really_probe(&pdev->dev, &gcc_sm6375_desc, regmap);
+ return qcom_cc_probe(pdev, &gcc_sm6375_desc);
}
static struct platform_driver gcc_sm6375_driver = {
--
2.54.0