[PATCH v2] clk: qcom: gcc-sm6375: Use common clock controller probe data
From: Abel Vesa
Date: Wed Sep 30 2026 - 10:16:18 EST
Move the always-on branch register offsets into a critical_cbcrs array
and describe the DFS RCGs through qcom_cc_driver_data.
Associate GPLL10, GPLL11, GPLL8 and GPLL9 with their existing configuration
data and list them in alpha_plls. The common PLL helper selects the Lucid
and Zonda configuration routines from their register layouts. This uses
the common initialization order, configuring the PLLs before enabling
the always-on branches, instead of the previous CBCR-before-PLL order.
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>
---
Changes in v2:
- Rebase on next-20260929.
- Configure GPLL10, GPLL11, GPLL8 and GPLL9 through alpha_plls.
- Drop the clk_regs_configure callback.
- Document the common PLL-before-CBCR initialization order.
- Link to v1: https://patch.msgid.link/20260926-clk-qcom-gcc-sm6375-rework-always-on-clocks-v1-1-28f581ab0289@xxxxxxxxxxxxxxxx
---
drivers/clk/qcom/gcc-sm6375.c | 50 ++++++++++++++++++++++++-------------------
1 file changed, 28 insertions(+), 22 deletions(-)
diff --git a/drivers/clk/qcom/gcc-sm6375.c b/drivers/clk/qcom/gcc-sm6375.c
index 9c2acf8dc4b7..2c7a6a4e2a2d 100644
--- a/drivers/clk/qcom/gcc-sm6375.c
+++ b/drivers/clk/qcom/gcc-sm6375.c
@@ -149,6 +149,7 @@ static const struct alpha_pll_config gpll10_config = {
};
static struct clk_alpha_pll gpll10 = {
+ .config = &gpll10_config,
.offset = 0xa000,
.vco_table = lucid_vco,
.num_vco = ARRAY_SIZE(lucid_vco),
@@ -181,6 +182,7 @@ static const struct alpha_pll_config gpll11_config = {
};
static struct clk_alpha_pll gpll11 = {
+ .config = &gpll11_config,
.offset = 0xb000,
.vco_table = lucid_vco,
.num_vco = ARRAY_SIZE(lucid_vco),
@@ -342,6 +344,7 @@ static const struct alpha_pll_config gpll8_config = {
};
static struct clk_alpha_pll gpll8 = {
+ .config = &gpll8_config,
.offset = 0x8000,
.vco_table = lucid_vco,
.num_vco = ARRAY_SIZE(lucid_vco),
@@ -395,6 +398,7 @@ static const struct alpha_pll_config gpll9_config = {
};
static struct clk_alpha_pll gpll9 = {
+ .config = &gpll9_config,
.offset = 0x9000,
.vco_table = zonda_vco,
.num_vco = ARRAY_SIZE(zonda_vco),
@@ -3853,7 +3857,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 struct clk_alpha_pll *gcc_sm6375_plls[] = {
+ &gpll10,
+ &gpll11,
+ &gpll8,
+ &gpll9,
+};
+
+static const struct qcom_cc_driver_data gcc_sm6375_driver_data = {
+ .alpha_plls = gcc_sm6375_plls,
+ .num_alpha_plls = ARRAY_SIZE(gcc_sm6375_plls),
+ .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),
+};
+
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 +3898,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 = {
---
base-commit: 6474fa070f2b8013b4b87350b775b8c3be6e8aac
change-id: 20260926-clk-qcom-gcc-sm6375-rework-always-on-clocks-b57ca73e75bb
Best regards,
--
Abel Vesa <abel.vesa@xxxxxxxxxxxxxxxx>