Skip to contentSkip to conversation

clk: qcom: camcc-sc7180: Use runtime PM ops instead of clk ones

PATCH Applied Stephen Boyd 4 participants 4 messages Nov 14, 2020 – Dec 29, 2020

Subsystems (3)
lore
Share & tools
lore

Stephen Boyd

author maintainer
#0 lore raw

PATCH 1/1 clk: qcom: camcc-sc7180: Use runtime PM ops instead of clk ones

Let's call pm_runtime_get() here instead of calling the PM clk APIs directly. This avoids a compilation problem on CONFIG_PM=n where the pm_clk_runtime_{resume,suspend}() functions don't exist and covers the intent, i.e. enable the clks for this device so we can program PLL settings.

Cc Nathan Chancellor <[email protected]>
Cc Stephen Rothwell <[email protected]>
Cc Taniya Das <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Fixes 15d09e830bbc ("clk: qcom: camcc: Add camera clock controller driver for SC7180")
---
 drivers/clk/qcom/camcc-sc7180.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/clk/qcom/camcc-sc7180.c +4 -8
index f51bf5b6decc..dbac5651ab85 100644
@@ -1669,16 +1669,14 @@ static int cam_cc_sc7180_probe(struct platform_device *pdev)
 		goto disable_pm_runtime;
 	}
 
-	ret = pm_clk_runtime_resume(&pdev->dev);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "pm runtime resume failed\n");
+	ret = pm_runtime_get(&pdev->dev);
+	if (ret)
 		goto destroy_pm_clk;
-	}
 
 	regmap = qcom_cc_map(pdev, &cam_cc_sc7180_desc);
 	if (IS_ERR(regmap)) {
 		ret = PTR_ERR(regmap);
-		pm_clk_runtime_suspend(&pdev->dev);
+		pm_runtime_put(&pdev->dev);
 		goto destroy_pm_clk;
 	}
 
@@ -1688,9 +1686,7 @@ static int cam_cc_sc7180_probe(struct platform_device *pdev)
 	clk_fabia_pll_configure(&cam_cc_pll3, regmap, &cam_cc_pll3_config);
 
 	ret = qcom_cc_really_probe(pdev, &cam_cc_sc7180_desc, regmap);
-
-	pm_clk_runtime_suspend(&pdev->dev);
-
+	pm_runtime_put(&pdev->dev);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to register CAM CC clocks\n");
 		goto destroy_pm_clk;
Signature · 1 line
https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/
Acked-by on v1 1/1
#1 lore raw
Quoted 6 lines · Stephen Boyd

Let's call pm_runtime_get() here instead of calling the PM clk APIs directly. This avoids a compilation problem on CONFIG_PM=n where the pm_clk_runtime_{resume,suspend}() functions don't exist and covers the intent, i.e. enable the clks for this device so we can program PLL settings.

Quoted 8 lines
Cc Nathan Chancellor <[email protected]>
Cc Stephen Rothwell <[email protected]>
Cc Taniya Das <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Fixes 15d09e830bbc ("clk: qcom: camcc: Add camera clock controller driver for SC7180")

Thanks.

Quoted 40 lines
---
 drivers/clk/qcom/camcc-sc7180.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/clk/qcom/camcc-sc7180.c +4 -8
index f51bf5b6decc..dbac5651ab85 100644
@@ -1669,16 +1669,14 @@ static int cam_cc_sc7180_probe(struct platform_device *pdev)
 		goto disable_pm_runtime;
 	}
 
-	ret = pm_clk_runtime_resume(&pdev->dev);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "pm runtime resume failed\n");
+	ret = pm_runtime_get(&pdev->dev);
+	if (ret)
 		goto destroy_pm_clk;
-	}
 
 	regmap = qcom_cc_map(pdev, &cam_cc_sc7180_desc);
 	if (IS_ERR(regmap)) {
 		ret = PTR_ERR(regmap);
-		pm_clk_runtime_suspend(&pdev->dev);
+		pm_runtime_put(&pdev->dev);
 		goto destroy_pm_clk;
 	}
 
@@ -1688,9 +1686,7 @@ static int cam_cc_sc7180_probe(struct platform_device *pdev)
 	clk_fabia_pll_configure(&cam_cc_pll3, regmap, &cam_cc_pll3_config);
 
 	ret = qcom_cc_really_probe(pdev, &cam_cc_sc7180_desc, regmap);
-
-	pm_clk_runtime_suspend(&pdev->dev);
-
+	pm_runtime_put(&pdev->dev);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to register CAM CC clocks\n");
 		goto destroy_pm_clk;
Signature · 1 line
~Randy
Reviewed-by on v1 1/1
#2 lore raw
In reply to Stephen Boyd
Quoted 6 lines · Stephen Boyd

Let's call pm_runtime_get() here instead of calling the PM clk APIs directly. This avoids a compilation problem on CONFIG_PM=n where the pm_clk_runtime_{resume,suspend}() functions don't exist and covers the intent, i.e. enable the clks for this device so we can program PLL settings.

Quoted 8 lines
Cc Nathan Chancellor <[email protected]>
Cc Stephen Rothwell <[email protected]>
Cc Taniya Das <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Fixes 15d09e830bbc ("clk: qcom: camcc: Add camera clock controller driver for SC7180")

Regards,
Bjorn

Quoted 42 lines
---
 drivers/clk/qcom/camcc-sc7180.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/clk/qcom/camcc-sc7180.c +4 -8
index f51bf5b6decc..dbac5651ab85 100644
@@ -1669,16 +1669,14 @@ static int cam_cc_sc7180_probe(struct platform_device *pdev)
 		goto disable_pm_runtime;
 	}
 
-	ret = pm_clk_runtime_resume(&pdev->dev);
-	if (ret < 0) {
-		dev_err(&pdev->dev, "pm runtime resume failed\n");
+	ret = pm_runtime_get(&pdev->dev);
+	if (ret)
 		goto destroy_pm_clk;
-	}
 
 	regmap = qcom_cc_map(pdev, &cam_cc_sc7180_desc);
 	if (IS_ERR(regmap)) {
 		ret = PTR_ERR(regmap);
-		pm_clk_runtime_suspend(&pdev->dev);
+		pm_runtime_put(&pdev->dev);
 		goto destroy_pm_clk;
 	}
 
@@ -1688,9 +1686,7 @@ static int cam_cc_sc7180_probe(struct platform_device *pdev)
 	clk_fabia_pll_configure(&cam_cc_pll3, regmap, &cam_cc_pll3_config);
 
 	ret = qcom_cc_really_probe(pdev, &cam_cc_sc7180_desc, regmap);
-
-	pm_clk_runtime_suspend(&pdev->dev);
-
+	pm_runtime_put(&pdev->dev);
 	if (ret < 0) {
 		dev_err(&pdev->dev, "Failed to register CAM CC clocks\n");
 		goto destroy_pm_clk;
Signature · 1 line
https://git.kernel.org/pub/scm/linux/kernel/git/clk/linux.git/
#3 lore raw
In reply to Stephen Boyd
This patch was applied to qcom/linux.git (refs/heads/for-next):

Hello:

This patch was applied to qcom/linux.git (refs/heads/for-next):

Quoted 15 lines · On Sat, 14 Nov 2020 09:44:08 -0800 you wrote:

Let's call pm_runtime_get() here instead of calling the PM clk APIs directly. This avoids a compilation problem on CONFIG_PM=n where the pm_clk_runtime_{resume,suspend}() functions don't exist and covers the intent, i.e. enable the clks for this device so we can program PLL settings.

Cc Nathan Chancellor <[email protected]>
Cc Stephen Rothwell <[email protected]>
Cc Taniya Das <[email protected]>
Cc "Rafael J. Wysocki" <[email protected]>
Fixes 15d09e830bbc ("clk: qcom: camcc: Add camera clock controller driver for SC7180")
Quoted 1 line

[...]

Here is the summary with links:
- clk: qcom: camcc-sc7180: Use runtime PM ops instead of clk ones

    https://git.kernel.org/qcom/c/8d4025943e13

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html