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

From: Abel Vesa

Date: Wed Sep 16 2026 - 07:04:29 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-sa8775p.c | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/clk/qcom/videocc-sa8775p.c b/drivers/clk/qcom/videocc-sa8775p.c
index 65a2d5bafea6..2ca78af8c20c 100644
--- a/drivers/clk/qcom/videocc-sa8775p.c
+++ b/drivers/clk/qcom/videocc-sa8775p.c
@@ -511,7 +511,19 @@ static const struct regmap_config video_cc_sa8775p_regmap_config = {
.fast_io = true,
};

+static const u32 video_cc_sa8775p_critical_cbcrs[] = {
+ 0x80ec, /* VIDEO_CC_AHB_CLK */
+ 0x8144, /* VIDEO_CC_SLEEP_CLK */
+ 0x8128, /* VIDEO_CC_XO_CLK */
+};
+
+static const struct qcom_cc_driver_data video_cc_sa8775p_driver_data = {
+ .clk_cbcrs = video_cc_sa8775p_critical_cbcrs,
+ .num_clk_cbcrs = ARRAY_SIZE(video_cc_sa8775p_critical_cbcrs),
+};
+
static const struct qcom_cc_desc video_cc_sa8775p_desc = {
+ .driver_data = &video_cc_sa8775p_driver_data,
.config = &video_cc_sa8775p_regmap_config,
.clks = video_cc_sa8775p_clocks,
.num_clks = ARRAY_SIZE(video_cc_sa8775p_clocks),
@@ -557,11 +569,6 @@ static int video_cc_sa8775p_probe(struct platform_device *pdev)
if (of_device_is_compatible(pdev->dev.of_node, "qcom,qcs8300-videocc"))
regmap_write(regmap, video_cc_mvs0c_div2_div_clk_src.reg, 2);

- /* Keep some clocks always enabled */
- qcom_branch_set_clk_en(regmap, 0x80ec); /* VIDEO_CC_AHB_CLK */
- qcom_branch_set_clk_en(regmap, 0x8144); /* VIDEO_CC_SLEEP_CLK */
- qcom_branch_set_clk_en(regmap, 0x8128); /* VIDEO_CC_XO_CLK */
-
ret = qcom_cc_really_probe(&pdev->dev, &video_cc_sa8775p_desc, regmap);

pm_runtime_put(&pdev->dev);

--
2.54.0