[PATCH 47/48] clk: qcom: videocc-sm8250: Use common probe handling for always-on clocks

From: Abel Vesa

Date: Wed Sep 16 2026 - 07:08:19 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.

Assisted-by: LLM
Signed-off-by: Abel Vesa <abel.vesa@xxxxxxxxxxxxxxxx>
---
drivers/clk/qcom/videocc-sm8250.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/drivers/clk/qcom/videocc-sm8250.c b/drivers/clk/qcom/videocc-sm8250.c
index df479a69cddd..d29d64138508 100644
--- a/drivers/clk/qcom/videocc-sm8250.c
+++ b/drivers/clk/qcom/videocc-sm8250.c
@@ -345,7 +345,18 @@ static const struct regmap_config video_cc_sm8250_regmap_config = {
.fast_io = true,
};

+static const u32 video_cc_sm8250_critical_cbcrs[] = {
+ 0xe58, /* VIDEO_CC_AHB_CLK */
+ 0xeec, /* VIDEO_CC_XO_CLK */
+};
+
+static const struct qcom_cc_driver_data video_cc_sm8250_driver_data = {
+ .clk_cbcrs = video_cc_sm8250_critical_cbcrs,
+ .num_clk_cbcrs = ARRAY_SIZE(video_cc_sm8250_critical_cbcrs),
+};
+
static const struct qcom_cc_desc video_cc_sm8250_desc = {
+ .driver_data = &video_cc_sm8250_driver_data,
.config = &video_cc_sm8250_regmap_config,
.clks = video_cc_sm8250_clocks,
.num_clks = ARRAY_SIZE(video_cc_sm8250_clocks),
@@ -383,10 +394,6 @@ static int video_cc_sm8250_probe(struct platform_device *pdev)
clk_lucid_pll_configure(&video_pll0, regmap, &video_pll0_config);
clk_lucid_pll_configure(&video_pll1, regmap, &video_pll1_config);

- /* Keep some clocks always-on */
- qcom_branch_set_clk_en(regmap, 0xe58); /* VIDEO_CC_AHB_CLK */
- qcom_branch_set_clk_en(regmap, 0xeec); /* VIDEO_CC_XO_CLK */
-
ret = qcom_cc_really_probe(&pdev->dev, &video_cc_sm8250_desc, regmap);

pm_runtime_put(&pdev->dev);

--
2.54.0