2023-05-29 13:20:41

by Konrad Dybcio

[permalink] [raw]
Subject: [PATCH 0/2] Add VDD_GX to SM6375 GPUCC

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. Take care of this.

Signed-off-by: Konrad Dybcio <[email protected]>
---
Konrad Dybcio (2):
dt-bindings: clock: sm6375-gpucc: Add VDD_GX
clk: qcom: gpucc-sm6375: Enable runtime pm

.../devicetree/bindings/clock/qcom,sm6375-gpucc.yaml | 15 +++++++++++++++
drivers/clk/qcom/gpucc-sm6375.c | 19 +++++++++++++++++--
2 files changed, 32 insertions(+), 2 deletions(-)
---
base-commit: 6a3d37b4d885129561e1cef361216f00472f7d2e
change-id: 20230529-topic-sm6375gpuccpd-ca741a64baf8

Best regards,
--
Konrad Dybcio <[email protected]>



2023-05-29 13:22:24

by Konrad Dybcio

[permalink] [raw]
Subject: [PATCH 2/2] 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 <[email protected]>
---
drivers/clk/qcom/gpucc-sm6375.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/qcom/gpucc-sm6375.c b/drivers/clk/qcom/gpucc-sm6375.c
index d3620344a009..2d863dc3d83b 100644
--- a/drivers/clk/qcom/gpucc-sm6375.c
+++ b/drivers/clk/qcom/gpucc-sm6375.c
@@ -7,6 +7,7 @@
#include <linux/clk-provider.h>
#include <linux/module.h>
#include <linux/of_device.h>
+#include <linux/pm_runtime.h>
#include <linux/regmap.h>

#include <dt-bindings/clock/qcom,sm6375-gpucc.h>
@@ -434,15 +435,29 @@ MODULE_DEVICE_TABLE(of, gpucc_sm6375_match_table);
static int gpucc_sm6375_probe(struct platform_device *pdev)
{
struct regmap *regmap;
+ int ret;
+
+ ret = devm_pm_runtime_enable(&pdev->dev);
+ if (ret)
+ return ret;
+
+ ret = pm_runtime_resume_and_get(&pdev->dev);
+ if (ret)
+ return ret;

regmap = qcom_cc_map(pdev, &gpucc_sm6375_desc);
- if (IS_ERR(regmap))
+ if (IS_ERR(regmap)) {
+ pm_runtime_put(&pdev->dev);
return PTR_ERR(regmap);
+ }

clk_lucid_pll_configure(&gpucc_pll0, regmap, &gpucc_pll0_config);
clk_lucid_pll_configure(&gpucc_pll1, regmap, &gpucc_pll1_config);

- return qcom_cc_really_probe(pdev, &gpucc_sm6375_desc, regmap);
+ ret = qcom_cc_really_probe(pdev, &gpucc_sm6375_desc, regmap);
+ pm_runtime_put(&pdev->dev);
+
+ return ret;
}

static struct platform_driver gpucc_sm6375_driver = {

--
2.40.1


2023-06-13 23:49:38

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 0/2] Add VDD_GX to SM6375 GPUCC

On Mon, 29 May 2023 15:14:22 +0200, Konrad Dybcio wrote:
> 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. Take care of this.
>
>

Applied, thanks!

[1/2] dt-bindings: clock: sm6375-gpucc: Add VDD_GX
commit: 2f138c667cb94a3a150d3341ca5ebf62480b501f
[2/2] clk: qcom: gpucc-sm6375: Enable runtime pm
commit: 097d359c8ca892b63e9d91bdfaf6c45d07c943c7

Best regards,
--
Bjorn Andersson <[email protected]>