From a03c45d40eaae7503fede5d289969f67dd9d3f3c Mon Sep 17 00:00:00 2001 From: Taniya Das Date: Tue, 1 Sep 2020 17:49:34 +0530 Subject: [PATCH] clk: qcom: smd-rpm: Add support for clock handoff During boot-up if the clock driver put across a initial high vote then there is no way to remove these votes which can cause the corresponding votes to be left always high till the CPU suspends causing power regression. Thus introduce a device property which can remove the initial votes from the clock driver and leave it up to the client to keep a vote. Change-Id: I068c87d06df908ee0ed0e58f69d46933b301ea6f Signed-off-by: Taniya Das --- drivers/clk/qcom/clk-smd-rpm.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/drivers/clk/qcom/clk-smd-rpm.c b/drivers/clk/qcom/clk-smd-rpm.c index 35a004119844..106d849e432e 100644 --- a/drivers/clk/qcom/clk-smd-rpm.c +++ b/drivers/clk/qcom/clk-smd-rpm.c @@ -912,7 +912,7 @@ static int rpm_smd_clk_probe(struct platform_device *pdev) { struct clk_hw **hw_clks; const struct rpm_smd_clk_desc *desc; - int ret, i, is_holi; + int ret, i, is_holi, hw_clk_handoff = false; desc = of_device_get_match_data(&pdev->dev); if (!desc) @@ -928,13 +928,17 @@ static int rpm_smd_clk_probe(struct platform_device *pdev) hw_clks = desc->clks; - for (i = 0; i < desc->num_clks; i++) { - if (!hw_clks[i]) - continue; + hw_clk_handoff = of_property_read_bool(pdev->dev.of_node, + "qcom,hw-clk-handoff"); + if (hw_clk_handoff) { + for (i = 0; i < desc->num_clks; i++) { + if (!hw_clks[i]) + continue; - ret = clk_smd_rpm_handoff(hw_clks[i]); - if (ret) - goto err; + ret = clk_smd_rpm_handoff(hw_clks[i]); + if (ret) + goto err; + } } ret = clk_smd_rpm_enable_scaling();