Skip to content

Commit d09ec6f

Browse files
konradybcioandersson
authored andcommitted
clk: qcom: Use qcom_branch_set_clk_en()
Instead of magically poking at the bit0 of branch clocks' CBCR, use the newly introduced helper. Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Reviewed-by: Johan Hovold <johan+linaro@kernel.org> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20240212-topic-clk_branch_en-v7-2-5b79eb7278b2@linaro.org Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent a58009d commit d09ec6f

38 files changed

Lines changed: 180 additions & 294 deletions

drivers/clk/qcom/camcc-sc8280xp.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3010,10 +3010,8 @@ static int camcc_sc8280xp_probe(struct platform_device *pdev)
30103010
clk_lucid_pll_configure(&camcc_pll6, regmap, &camcc_pll6_config);
30113011
clk_lucid_pll_configure(&camcc_pll7, regmap, &camcc_pll7_config);
30123012

3013-
/*
3014-
* Keep camcc_gdsc_clk always enabled:
3015-
*/
3016-
regmap_update_bits(regmap, 0xc1e4, BIT(0), 1);
3013+
/* Keep some clocks always-on */
3014+
qcom_branch_set_clk_en(regmap, 0xc1e4); /* CAMCC_GDSC_CLK */
30173015

30183016
ret = qcom_cc_really_probe(pdev, &camcc_sc8280xp_desc, regmap);
30193017
if (ret)

drivers/clk/qcom/camcc-sm8550.c

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3536,13 +3536,9 @@ static int cam_cc_sm8550_probe(struct platform_device *pdev)
35363536
clk_lucid_ole_pll_configure(&cam_cc_pll11, regmap, &cam_cc_pll11_config);
35373537
clk_lucid_ole_pll_configure(&cam_cc_pll12, regmap, &cam_cc_pll12_config);
35383538

3539-
/*
3540-
* Keep clocks always enabled:
3541-
* cam_cc_gdsc_clk
3542-
* cam_cc_sleep_clk
3543-
*/
3544-
regmap_update_bits(regmap, 0x1419c, BIT(0), BIT(0));
3545-
regmap_update_bits(regmap, 0x142cc, BIT(0), BIT(0));
3539+
/* Keep some clocks always-on */
3540+
qcom_branch_set_clk_en(regmap, 0x1419c); /* CAM_CC_GDSC_CLK */
3541+
qcom_branch_set_clk_en(regmap, 0x142cc); /* CAM_CC_SLEEP_CLK */
35463542

35473543
ret = qcom_cc_really_probe(pdev, &cam_cc_sm8550_desc, regmap);
35483544

drivers/clk/qcom/camcc-x1e80100.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2462,8 +2462,8 @@ static int cam_cc_x1e80100_probe(struct platform_device *pdev)
24622462
clk_lucid_ole_pll_configure(&cam_cc_pll8, regmap, &cam_cc_pll8_config);
24632463

24642464
/* Keep clocks always enabled */
2465-
regmap_update_bits(regmap, 0x13a9c, BIT(0), BIT(0)); /* cam_cc_gdsc_clk */
2466-
regmap_update_bits(regmap, 0x13ab8, BIT(0), BIT(0)); /* cam_cc_sleep_clk */
2465+
qcom_branch_set_clk_en(regmap, 0x13a9c); /* CAM_CC_GDSC_CLK */
2466+
qcom_branch_set_clk_en(regmap, 0x13ab8); /* CAM_CC_SLEEP_CLK */
24672467

24682468
ret = qcom_cc_really_probe(pdev, &cam_cc_x1e80100_desc, regmap);
24692469

drivers/clk/qcom/dispcc-qcm2290.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,8 @@ static int disp_cc_qcm2290_probe(struct platform_device *pdev)
519519

520520
clk_alpha_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config);
521521

522-
/* Keep DISP_CC_XO_CLK always-ON */
523-
regmap_update_bits(regmap, 0x604c, BIT(0), BIT(0));
522+
/* Keep some clocks always-on */
523+
qcom_branch_set_clk_en(regmap, 0x604c); /* DISP_CC_XO_CLK */
524524

525525
ret = qcom_cc_really_probe(pdev, &disp_cc_qcm2290_desc, regmap);
526526
if (ret) {

drivers/clk/qcom/dispcc-sc7280.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -878,11 +878,8 @@ static int disp_cc_sc7280_probe(struct platform_device *pdev)
878878

879879
clk_lucid_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config);
880880

881-
/*
882-
* Keep the clocks always-ON
883-
* DISP_CC_XO_CLK
884-
*/
885-
regmap_update_bits(regmap, 0x5008, BIT(0), BIT(0));
881+
/* Keep some clocks always-on */
882+
qcom_branch_set_clk_en(regmap, 0x5008); /* DISP_CC_XO_CLK */
886883

887884
return qcom_cc_really_probe(pdev, &disp_cc_sc7280_desc, regmap);
888885
}

drivers/clk/qcom/dispcc-sc8280xp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3178,8 +3178,8 @@ static int disp_cc_sc8280xp_probe(struct platform_device *pdev)
31783178
goto out_pm_runtime_put;
31793179
}
31803180

3181-
/* DISP_CC_XO_CLK always-on */
3182-
regmap_update_bits(regmap, 0x605c, BIT(0), BIT(0));
3181+
/* Keep some clocks always-on */
3182+
qcom_branch_set_clk_en(regmap, 0x605c); /* DISP_CC_XO_CLK */
31833183

31843184
out_pm_runtime_put:
31853185
pm_runtime_put_sync(&pdev->dev);

drivers/clk/qcom/dispcc-sm6115.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -583,8 +583,8 @@ static int disp_cc_sm6115_probe(struct platform_device *pdev)
583583

584584
clk_alpha_pll_configure(&disp_cc_pll0, regmap, &disp_cc_pll0_config);
585585

586-
/* Keep DISP_CC_XO_CLK always-ON */
587-
regmap_update_bits(regmap, 0x604c, BIT(0), BIT(0));
586+
/* Keep some clocks always-on */
587+
qcom_branch_set_clk_en(regmap, 0x604c); /* DISP_CC_XO_CLK */
588588

589589
ret = qcom_cc_really_probe(pdev, &disp_cc_sm6115_desc, regmap);
590590
if (ret) {

drivers/clk/qcom/dispcc-sm8250.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1363,8 +1363,8 @@ static int disp_cc_sm8250_probe(struct platform_device *pdev)
13631363
/* Enable clock gating for MDP clocks */
13641364
regmap_update_bits(regmap, 0x8000, 0x10, 0x10);
13651365

1366-
/* DISP_CC_XO_CLK always-on */
1367-
regmap_update_bits(regmap, 0x605c, BIT(0), BIT(0));
1366+
/* Keep some clocks always-on */
1367+
qcom_branch_set_clk_en(regmap, 0x605c); /* DISP_CC_XO_CLK */
13681368

13691369
ret = qcom_cc_really_probe(pdev, &disp_cc_sm8250_desc, regmap);
13701370

drivers/clk/qcom/dispcc-sm8450.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,11 +1787,8 @@ static int disp_cc_sm8450_probe(struct platform_device *pdev)
17871787
/* Enable clock gating for MDP clocks */
17881788
regmap_update_bits(regmap, DISP_CC_MISC_CMD, 0x10, 0x10);
17891789

1790-
/*
1791-
* Keep clocks always enabled:
1792-
* disp_cc_xo_clk
1793-
*/
1794-
regmap_update_bits(regmap, 0xe05c, BIT(0), BIT(0));
1790+
/* Keep some clocks always-on */
1791+
qcom_branch_set_clk_en(regmap, 0xe05c); /* DISP_CC_XO_CLK */
17951792

17961793
ret = qcom_cc_really_probe(pdev, &disp_cc_sm8450_desc, regmap);
17971794
if (ret)

drivers/clk/qcom/dispcc-sm8550.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,11 +1780,8 @@ static int disp_cc_sm8550_probe(struct platform_device *pdev)
17801780
/* Enable clock gating for MDP clocks */
17811781
regmap_update_bits(regmap, DISP_CC_MISC_CMD, 0x10, 0x10);
17821782

1783-
/*
1784-
* Keep clocks always enabled:
1785-
* disp_cc_xo_clk
1786-
*/
1787-
regmap_update_bits(regmap, 0xe054, BIT(0), BIT(0));
1783+
/* Keep some clocks always-on */
1784+
qcom_branch_set_clk_en(regmap, 0xe054); /* DISP_CC_XO_CLK */
17881785

17891786
ret = qcom_cc_really_probe(pdev, &disp_cc_sm8550_desc, regmap);
17901787
if (ret)

0 commit comments

Comments
 (0)