clk: qcom: gcc-sdx75: Use common clock controller probe data

Move the always-on branch register offsets into a critical_cbcrs array
and describe the DFS RCGs through qcom_cc_driver_data.

Use qcom_cc_probe() to perform the common initialization instead of
open-coding it in the driver's probe.

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-25-1479443ee016@oss.qualcomm.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This commit is contained in:
Abel Vesa 2026-09-24 15:06:37 +03:00 committed by Bjorn Andersson
parent b1a8564a6d
commit 9f9129abcb

View File

@ -2905,7 +2905,20 @@ static const struct regmap_config gcc_sdx75_regmap_config = {
.fast_io = true,
};
static const u32 gcc_sdx75_critical_cbcrs[] = {
0x3e004, /* GCC_AHB_PCIE_LINK_CLK */
0x3e008, /* GCC_XO_PCIE_LINK_CLK */
};
static const struct qcom_cc_driver_data gcc_sdx75_driver_data = {
.clk_cbcrs = gcc_sdx75_critical_cbcrs,
.num_clk_cbcrs = ARRAY_SIZE(gcc_sdx75_critical_cbcrs),
.dfs_rcgs = gcc_dfs_clocks,
.num_dfs_rcgs = ARRAY_SIZE(gcc_dfs_clocks),
};
static const struct qcom_cc_desc gcc_sdx75_desc = {
.driver_data = &gcc_sdx75_driver_data,
.config = &gcc_sdx75_regmap_config,
.clks = gcc_sdx75_clocks,
.num_clks = ARRAY_SIZE(gcc_sdx75_clocks),
@ -2924,23 +2937,7 @@ MODULE_DEVICE_TABLE(of, gcc_sdx75_match_table);
static int gcc_sdx75_probe(struct platform_device *pdev)
{
struct regmap *regmap;
int ret;
regmap = qcom_cc_map(pdev, &gcc_sdx75_desc);
if (IS_ERR(regmap))
return PTR_ERR(regmap);
ret = qcom_cc_register_rcg_dfs(regmap, gcc_dfs_clocks,
ARRAY_SIZE(gcc_dfs_clocks));
if (ret)
return ret;
/* Keep some clocks always-on */
qcom_branch_set_clk_en(regmap, 0x3e004); /* GCC_AHB_PCIE_LINK_CLK */
qcom_branch_set_clk_en(regmap, 0x3e008); /* GCC_XO_PCIE_LINK_CLK */
return qcom_cc_really_probe(&pdev->dev, &gcc_sdx75_desc, regmap);
return qcom_cc_probe(pdev, &gcc_sdx75_desc);
}
static struct platform_driver gcc_sdx75_driver = {