Skip to content

Commit 2a541ab

Browse files
konradybcioandersson
authored andcommitted
clk: qcom: gcc-sc8280xp: Add runtime PM
The GCC block on SC8280XP is powered by the CX rail. We need to ensure that it's enabled to prevent unwanted power collapse. Enable runtime PM to keep the power flowing only when necessary. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20230619-topic-sc8280xp-clk-rpm-v1-2-1e5e1064cdb2@linaro.org Signed-off-by: Bjorn Andersson <andersson@kernel.org>
1 parent 9bbcb89 commit 2a541ab

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

drivers/clk/qcom/gcc-sc8280xp.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#include <linux/kernel.h>
1010
#include <linux/module.h>
1111
#include <linux/of_device.h>
12+
#include <linux/pm_runtime.h>
1213
#include <linux/of.h>
1314
#include <linux/regmap.h>
1415

@@ -7421,9 +7422,19 @@ static int gcc_sc8280xp_probe(struct platform_device *pdev)
74217422
struct regmap *regmap;
74227423
int ret;
74237424

7425+
ret = devm_pm_runtime_enable(&pdev->dev);
7426+
if (ret)
7427+
return ret;
7428+
7429+
ret = pm_runtime_resume_and_get(&pdev->dev);
7430+
if (ret)
7431+
return ret;
7432+
74247433
regmap = qcom_cc_map(pdev, &gcc_sc8280xp_desc);
7425-
if (IS_ERR(regmap))
7434+
if (IS_ERR(regmap)) {
7435+
pm_runtime_put(&pdev->dev);
74267436
return PTR_ERR(regmap);
7437+
}
74277438

74287439
/*
74297440
* Keep the clocks always-ON
@@ -7445,7 +7456,10 @@ static int gcc_sc8280xp_probe(struct platform_device *pdev)
74457456
if (ret)
74467457
return ret;
74477458

7448-
return qcom_cc_really_probe(pdev, &gcc_sc8280xp_desc, regmap);
7459+
ret = qcom_cc_really_probe(pdev, &gcc_sc8280xp_desc, regmap);
7460+
pm_runtime_put(&pdev->dev);
7461+
7462+
return ret;
74497463
}
74507464

74517465
static const struct of_device_id gcc_sc8280xp_match_table[] = {

0 commit comments

Comments
 (0)