clk: qcom: lpasscorecc-sc7180: Use common probe handling for always-on clocks

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
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Abel Vesa <abel.vesa@oss.qualcomm.com>
Link: https://patch.msgid.link/20260924-clk-qcom-rework-legacy-always-on-clocks-v2-43-1479443ee016@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This commit is contained in:
Abel Vesa 2026-09-24 15:06:55 +03:00 committed by Bjorn Andersson
parent cb86d0de93
commit a2babcf697

View File

@ -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: