From 7cd427f13a099f35ff96cd00f0ebabbf8e7eee7e Mon Sep 17 00:00:00 2001 From: Abel Vesa Date: Thu, 24 Sep 2026 15:06:58 +0300 Subject: [PATCH] clk: qcom: videocc-sm7150: 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. Assisted-by: LLM Reviewed-by: Konrad Dybcio Signed-off-by: Abel Vesa Link: https://patch.msgid.link/20260924-clk-qcom-rework-legacy-always-on-clocks-v2-46-1479443ee016@oss.qualcomm.com Signed-off-by: Bjorn Andersson --- drivers/clk/qcom/videocc-sm7150.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/clk/qcom/videocc-sm7150.c b/drivers/clk/qcom/videocc-sm7150.c index 8d2e00799f96..32bad5e09056 100644 --- a/drivers/clk/qcom/videocc-sm7150.c +++ b/drivers/clk/qcom/videocc-sm7150.c @@ -313,7 +313,17 @@ static const struct regmap_config videocc_sm7150_regmap_config = { .fast_io = true, }; +static const u32 videocc_sm7150_critical_cbcrs[] = { + 0x984, /* VIDEOCC_XO_CLK */ +}; + +static const struct qcom_cc_driver_data videocc_sm7150_driver_data = { + .clk_cbcrs = videocc_sm7150_critical_cbcrs, + .num_clk_cbcrs = ARRAY_SIZE(videocc_sm7150_critical_cbcrs), +}; + static const struct qcom_cc_desc videocc_sm7150_desc = { + .driver_data = &videocc_sm7150_driver_data, .config = &videocc_sm7150_regmap_config, .clks = videocc_sm7150_clocks, .num_clks = ARRAY_SIZE(videocc_sm7150_clocks), @@ -337,9 +347,6 @@ static int videocc_sm7150_probe(struct platform_device *pdev) clk_fabia_pll_configure(&videocc_pll0, regmap, &videocc_pll0_config); - /* Keep some clocks always-on */ - qcom_branch_set_clk_en(regmap, 0x984); /* VIDEOCC_XO_CLK */ - return qcom_cc_really_probe(&pdev->dev, &videocc_sm7150_desc, regmap); }