mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
clk: qcom: gcc-sdx65: 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-24-1479443ee016@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This commit is contained in:
parent
d4e4e1be4a
commit
b1a8564a6d
|
|
@ -1551,7 +1551,25 @@ static const struct regmap_config gcc_sdx65_regmap_config = {
|
|||
.fast_io = true,
|
||||
};
|
||||
|
||||
static const u32 gcc_sdx65_critical_cbcrs[] = {
|
||||
0x6d008, /* GCC_SYS_NOC_CPUSS_AHB_CLK */
|
||||
};
|
||||
|
||||
static void gcc_sdx65_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_sdx65_driver_data = {
|
||||
.clk_cbcrs = gcc_sdx65_critical_cbcrs,
|
||||
.num_clk_cbcrs = ARRAY_SIZE(gcc_sdx65_critical_cbcrs),
|
||||
.clk_regs_configure = gcc_sdx65_regs_configure,
|
||||
};
|
||||
|
||||
static const struct qcom_cc_desc gcc_sdx65_desc = {
|
||||
.driver_data = &gcc_sdx65_driver_data,
|
||||
.config = &gcc_sdx65_regmap_config,
|
||||
.clks = gcc_sdx65_clocks,
|
||||
.num_clks = ARRAY_SIZE(gcc_sdx65_clocks),
|
||||
|
|
@ -1569,18 +1587,7 @@ MODULE_DEVICE_TABLE(of, gcc_sdx65_match_table);
|
|||
|
||||
static int gcc_sdx65_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct regmap *regmap;
|
||||
|
||||
regmap = qcom_cc_map(pdev, &gcc_sdx65_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_sdx65_desc, regmap);
|
||||
return qcom_cc_probe(pdev, &gcc_sdx65_desc);
|
||||
}
|
||||
|
||||
static struct platform_driver gcc_sdx65_driver = {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user