[PATCH 43/48] clk: qcom: lpasscorecc-sc7180: Use common probe handling for always-on clocks

From: Abel Vesa

Date: Wed Sep 16 2026 - 06:44:49 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.

Move the PLL register setup into the clk_regs_configure callback so it
still follows the SYSNOC branch enable. Attach this data only to the
LPASS core clock controller descriptor.

Assisted-by: LLM
Signed-off-by: Abel Vesa <abel.vesa@xxxxxxxxxxxxxxxx>
---
drivers/clk/qcom/lpasscorecc-sc7180.c | 31 +++++++++++++++++++++----------
1 file changed, 21 insertions(+), 10 deletions(-)

diff --git a/drivers/clk/qcom/lpasscorecc-sc7180.c b/drivers/clk/qcom/lpasscorecc-sc7180.c
index 5174bd3dcdc5..af28da5f04b3 100644
--- a/drivers/clk/qcom/lpasscorecc-sc7180.c
+++ b/drivers/clk/qcom/lpasscorecc-sc7180.c
@@ -343,7 +343,28 @@ static const struct qcom_cc_desc lpass_core_hm_sc7180_desc = {
.num_gdscs = ARRAY_SIZE(lpass_core_hm_sc7180_gdscs),
};

+static const u32 lpass_core_cc_sc7180_critical_cbcrs[] = {
+ 0x24000, /* LPASS_AUDIO_CORE_SYSNOC_SWAY_CORE_CLK */
+};
+
+static void lpass_core_cc_sc7180_regs_configure(struct device *dev, struct regmap *regmap)
+{
+ /* PLL settings */
+ regmap_write(regmap, 0x1008, 0x20);
+ regmap_update_bits(regmap, 0x1014, BIT(0), BIT(0));
+
+ clk_fabia_pll_configure(&lpass_lpaaudio_dig_pll, regmap,
+ &lpass_lpaaudio_dig_pll_config);
+}
+
+static const struct qcom_cc_driver_data lpass_core_cc_sc7180_driver_data = {
+ .clk_cbcrs = lpass_core_cc_sc7180_critical_cbcrs,
+ .num_clk_cbcrs = ARRAY_SIZE(lpass_core_cc_sc7180_critical_cbcrs),
+ .clk_regs_configure = lpass_core_cc_sc7180_regs_configure,
+};
+
static const struct qcom_cc_desc lpass_core_cc_sc7180_desc = {
+ .driver_data = &lpass_core_cc_sc7180_driver_data,
.config = &lpass_core_cc_sc7180_regmap_config,
.clks = lpass_core_cc_sc7180_clocks,
.num_clks = ARRAY_SIZE(lpass_core_cc_sc7180_clocks),
@@ -400,16 +421,6 @@ static int lpass_core_cc_sc7180_probe(struct platform_device *pdev)
goto exit;
}

- /* Keep some clocks always-on */
- qcom_branch_set_clk_en(regmap, 0x24000); /* LPASS_AUDIO_CORE_SYSNOC_SWAY_CORE_CLK */
-
- /* PLL settings */
- regmap_write(regmap, 0x1008, 0x20);
- regmap_update_bits(regmap, 0x1014, BIT(0), BIT(0));
-
- clk_fabia_pll_configure(&lpass_lpaaudio_dig_pll, regmap,
- &lpass_lpaaudio_dig_pll_config);
-
ret = qcom_cc_really_probe(&pdev->dev, &lpass_core_cc_sc7180_desc, regmap);

exit:

--
2.54.0