mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
clk: qcom: videocc-sm8350: 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. Keep separate CBCR arrays for SM8350 and SC8280XP to preserve their different XO clock register offsets. 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-48-1479443ee016@oss.qualcomm.com Signed-off-by: Bjorn Andersson <andersson@kernel.org>
This commit is contained in:
parent
0bbc2402d8
commit
4baa772ecd
|
|
@ -510,7 +510,28 @@ static const struct regmap_config video_cc_sm8350_regmap_config = {
|
|||
.fast_io = true,
|
||||
};
|
||||
|
||||
static const u32 video_cc_sm8350_critical_cbcrs[] = {
|
||||
0xe58, /* VIDEO_CC_AHB_CLK */
|
||||
0xeec, /* VIDEO_CC_XO_CLK */
|
||||
};
|
||||
|
||||
static const u32 video_cc_sc8280xp_critical_cbcrs[] = {
|
||||
0xe58, /* VIDEO_CC_AHB_CLK */
|
||||
0xf34, /* VIDEO_CC_XO_CLK */
|
||||
};
|
||||
|
||||
static const struct qcom_cc_driver_data video_cc_sm8350_driver_data = {
|
||||
.clk_cbcrs = video_cc_sm8350_critical_cbcrs,
|
||||
.num_clk_cbcrs = ARRAY_SIZE(video_cc_sm8350_critical_cbcrs),
|
||||
};
|
||||
|
||||
static const struct qcom_cc_driver_data video_cc_sc8280xp_driver_data = {
|
||||
.clk_cbcrs = video_cc_sc8280xp_critical_cbcrs,
|
||||
.num_clk_cbcrs = ARRAY_SIZE(video_cc_sc8280xp_critical_cbcrs),
|
||||
};
|
||||
|
||||
static const struct qcom_cc_desc video_cc_sm8350_desc = {
|
||||
.driver_data = &video_cc_sm8350_driver_data,
|
||||
.config = &video_cc_sm8350_regmap_config,
|
||||
.clks = video_cc_sm8350_clocks,
|
||||
.num_clks = ARRAY_SIZE(video_cc_sm8350_clocks),
|
||||
|
|
@ -522,7 +543,7 @@ static const struct qcom_cc_desc video_cc_sm8350_desc = {
|
|||
|
||||
static int video_cc_sm8350_probe(struct platform_device *pdev)
|
||||
{
|
||||
u32 video_cc_xo_clk_cbcr = 0xeec;
|
||||
struct qcom_cc_desc desc = video_cc_sm8350_desc;
|
||||
struct regmap *regmap;
|
||||
int ret;
|
||||
|
||||
|
|
@ -539,7 +560,7 @@ static int video_cc_sm8350_probe(struct platform_device *pdev)
|
|||
video_cc_sleep_clk.halt_reg = 0xf58;
|
||||
video_cc_sleep_clk.clkr.enable_reg = 0xf58;
|
||||
video_cc_xo_clk_src.cmd_rcgr = 0xf14;
|
||||
video_cc_xo_clk_cbcr = 0xf34;
|
||||
desc.driver_data = &video_cc_sc8280xp_driver_data;
|
||||
|
||||
video_pll0.vco_table = video_pll1.vco_table = lucid_5lpe_vco_8280xp;
|
||||
/* No change, but assign it for completeness */
|
||||
|
|
@ -558,11 +579,7 @@ static int video_cc_sm8350_probe(struct platform_device *pdev)
|
|||
clk_lucid_pll_configure(&video_pll0, regmap, &video_pll0_config);
|
||||
clk_lucid_pll_configure(&video_pll1, regmap, &video_pll1_config);
|
||||
|
||||
/* Keep some clocks always-on */
|
||||
qcom_branch_set_clk_en(regmap, 0xe58); /* VIDEO_CC_AHB_CLK */
|
||||
qcom_branch_set_clk_en(regmap, video_cc_xo_clk_cbcr); /* VIDEO_CC_XO_CLK */
|
||||
|
||||
ret = qcom_cc_really_probe(&pdev->dev, &video_cc_sm8350_desc, regmap);
|
||||
ret = qcom_cc_really_probe(&pdev->dev, &desc, regmap);
|
||||
pm_runtime_put(&pdev->dev);
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user