mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
clk: qcom: gcc-sdx55: Use common clock controller probe data
Move the always-on branch register offsets into a critical_cbcrs array and move the register programming into the clk_regs_configure callback. 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-23-1479443ee016@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This commit is contained in:
parent
63e284bce7
commit
d4e4e1be4a
|
|
@ -1587,7 +1587,25 @@ static const struct regmap_config gcc_sdx55_regmap_config = {
|
|||
.fast_io = true,
|
||||
};
|
||||
|
||||
static const u32 gcc_sdx55_critical_cbcrs[] = {
|
||||
0x6d008, /* GCC_SYS_NOC_CPUSS_AHB_CLK */
|
||||
};
|
||||
|
||||
static void gcc_sdx55_regs_configure(struct device *dev, struct regmap *regmap)
|
||||
{
|
||||
/* Keep some clocks always-on */
|
||||
regmap_update_bits(regmap, 0x6d008, BIT(21), BIT(21)); /* GCC_CPUSS_AHB_CLK */
|
||||
regmap_update_bits(regmap, 0x6d008, BIT(22), BIT(22)); /* GCC_CPUSS_GNOC_CLK */
|
||||
}
|
||||
|
||||
static const struct qcom_cc_driver_data gcc_sdx55_driver_data = {
|
||||
.clk_cbcrs = gcc_sdx55_critical_cbcrs,
|
||||
.num_clk_cbcrs = ARRAY_SIZE(gcc_sdx55_critical_cbcrs),
|
||||
.clk_regs_configure = gcc_sdx55_regs_configure,
|
||||
};
|
||||
|
||||
static const struct qcom_cc_desc gcc_sdx55_desc = {
|
||||
.driver_data = &gcc_sdx55_driver_data,
|
||||
.config = &gcc_sdx55_regmap_config,
|
||||
.clks = gcc_sdx55_clocks,
|
||||
.num_clks = ARRAY_SIZE(gcc_sdx55_clocks),
|
||||
|
|
@ -1605,18 +1623,7 @@ MODULE_DEVICE_TABLE(of, gcc_sdx55_match_table);
|
|||
|
||||
static int gcc_sdx55_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct regmap *regmap;
|
||||
|
||||
regmap = qcom_cc_map(pdev, &gcc_sdx55_desc);
|
||||
if (IS_ERR(regmap))
|
||||
return PTR_ERR(regmap);
|
||||
|
||||
/* Keep some clocks always-on */
|
||||
qcom_branch_set_clk_en(regmap, 0x6d008); /* GCC_SYS_NOC_CPUSS_AHB_CLK */
|
||||
regmap_update_bits(regmap, 0x6d008, BIT(21), BIT(21)); /* GCC_CPUSS_AHB_CLK */
|
||||
regmap_update_bits(regmap, 0x6d008, BIT(22), BIT(22)); /* GCC_CPUSS_GNOC_CLK */
|
||||
|
||||
return qcom_cc_really_probe(&pdev->dev, &gcc_sdx55_desc, regmap);
|
||||
return qcom_cc_probe(pdev, &gcc_sdx55_desc);
|
||||
}
|
||||
|
||||
static struct platform_driver gcc_sdx55_driver = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user