Skip to content

Commit 097d359

Browse files
konradybcioandersson
authored andcommitted
clk: qcom: gpucc-sm6375: Enable runtime pm
The GPUCC block on SM6375 is powered by VDD_CX and VDD_GX. If the latter rail is not online, GX_GDSC will never turn on. Enable runtime pm so that we can reference VDD_GX from the dt to ensure that. Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> Signed-off-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20230529-topic-sm6375gpuccpd-v1-2-8d57c41a6066@linaro.org
1 parent 2f138c6 commit 097d359

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

drivers/clk/qcom/gpucc-sm6375.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <linux/clk-provider.h>
88
#include <linux/module.h>
99
#include <linux/of_device.h>
10+
#include <linux/pm_runtime.h>
1011
#include <linux/regmap.h>
1112

1213
#include <dt-bindings/clock/qcom,sm6375-gpucc.h>
@@ -434,15 +435,29 @@ MODULE_DEVICE_TABLE(of, gpucc_sm6375_match_table);
434435
static int gpucc_sm6375_probe(struct platform_device *pdev)
435436
{
436437
struct regmap *regmap;
438+
int ret;
439+
440+
ret = devm_pm_runtime_enable(&pdev->dev);
441+
if (ret)
442+
return ret;
443+
444+
ret = pm_runtime_resume_and_get(&pdev->dev);
445+
if (ret)
446+
return ret;
437447

438448
regmap = qcom_cc_map(pdev, &gpucc_sm6375_desc);
439-
if (IS_ERR(regmap))
449+
if (IS_ERR(regmap)) {
450+
pm_runtime_put(&pdev->dev);
440451
return PTR_ERR(regmap);
452+
}
441453

442454
clk_lucid_pll_configure(&gpucc_pll0, regmap, &gpucc_pll0_config);
443455
clk_lucid_pll_configure(&gpucc_pll1, regmap, &gpucc_pll1_config);
444456

445-
return qcom_cc_really_probe(pdev, &gpucc_sm6375_desc, regmap);
457+
ret = qcom_cc_really_probe(pdev, &gpucc_sm6375_desc, regmap);
458+
pm_runtime_put(&pdev->dev);
459+
460+
return ret;
446461
}
447462

448463
static struct platform_driver gpucc_sm6375_driver = {

0 commit comments

Comments
 (0)