All of lore.kernel.org
 help / color / mirror / Atom feed
From: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
To: svarbanov@mm-sol.com, linux-pci@vger.kernel.org, bhelgaas@google.com
Cc: robh+dt@kernel.org, linux-arm-msm@vger.kernel.org,
	srinivas.kandagatla@linaro.org, devicetree@vger.kernel.org
Subject: [PATCH v4 1/3] bus: simple-pm: add support to pm clocks
Date: Mon, 14 Nov 2016 11:15:53 +0000	[thread overview]
Message-ID: <1479122155-13393-2-git-send-email-srinivas.kandagatla@linaro.org> (raw)
In-Reply-To: <1479122155-13393-1-git-send-email-srinivas.kandagatla@linaro.org>

This patch adds support to pm clocks via device tree, so that the clocks
can be turned on and off during runtime pm. This patch is required for
Qualcomm msm8996 pcie controller which sits on a bus with its own
power-domain and clocks.

Without this patch the clock associated with the bus are never turned on.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
---
 drivers/bus/simple-pm-bus.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c
index c5eb46c..63b7e8c 100644
--- a/drivers/bus/simple-pm-bus.c
+++ b/drivers/bus/simple-pm-bus.c
@@ -11,6 +11,7 @@
 #include <linux/module.h>
 #include <linux/of_platform.h>
 #include <linux/platform_device.h>
+#include <linux/pm_clock.h>
 #include <linux/pm_runtime.h>
 
 
@@ -22,17 +23,26 @@ static int simple_pm_bus_probe(struct platform_device *pdev)
 
 	pm_runtime_enable(&pdev->dev);
 
-	if (np)
+	if (np) {
+		of_pm_clk_add_clks(&pdev->dev);
 		of_platform_populate(np, NULL, NULL, &pdev->dev);
+	}
 
 	return 0;
 }
 
+static const struct dev_pm_ops simple_pm_bus_pm_ops = {
+	SET_RUNTIME_PM_OPS(pm_clk_suspend,
+			   pm_clk_resume, NULL)
+};
+
 static int simple_pm_bus_remove(struct platform_device *pdev)
 {
 	dev_dbg(&pdev->dev, "%s\n", __func__);
 
 	pm_runtime_disable(&pdev->dev);
+	pm_clk_destroy(&pdev->dev);
+
 	return 0;
 }
 
@@ -48,6 +58,7 @@ static struct platform_driver simple_pm_bus_driver = {
 	.driver = {
 		.name = "simple-pm-bus",
 		.of_match_table = simple_pm_bus_of_match,
+		.pm = &simple_pm_bus_pm_ops,
 	},
 };
 
-- 
2.10.1

  reply	other threads:[~2016-11-14 11:15 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-14 11:15 [PATCH v4 0/3] PCI: qcom: Add support to msm8996 pcie controller Srinivas Kandagatla
2016-11-14 11:15 ` Srinivas Kandagatla [this message]
2016-11-14 22:14   ` [PATCH v4 1/3] bus: simple-pm: add support to pm clocks Bjorn Helgaas
     [not found]     ` <20161114221447.GH9868-1RhO1Y9PlrlHTL0Zs8A6p5iNqAH0jzoTYJqu5kTmcBRl57MIdRCFDg@public.gmane.org>
2016-11-15  8:23       ` Geert Uytterhoeven
2016-11-15  8:23         ` Geert Uytterhoeven
2016-11-15 11:25         ` Srinivas Kandagatla
2016-11-16 15:50           ` Nayak, Rajendra
2016-11-16 16:33             ` Srinivas Kandagatla
     [not found]         ` <CAMuHMdUJ8Qn=dR_OMob4BO_4RmY5XemTf_UGM_oJ2VYtBa7Jiw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-12-15 22:26           ` Bjorn Andersson
2016-12-15 22:26             ` Bjorn Andersson
2016-12-16  8:33             ` Geert Uytterhoeven
2016-11-14 11:15 ` [PATCH v4 2/3] PCI: qcom: add support to msm8996 PCIE controller Srinivas Kandagatla
2016-11-14 14:04   ` Vivek Gautam
     [not found]   ` <1479122155-13393-3-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-11-14 22:23     ` Bjorn Helgaas
2016-11-14 22:23       ` Bjorn Helgaas
2016-11-15 12:24   ` Stanimir Varbanov
     [not found]     ` <aa135735-4ff4-06e3-7899-1255a21edfb4-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2016-11-15 13:22       ` Srinivas Kandagatla
2016-11-15 13:22         ` Srinivas Kandagatla
     [not found]         ` <f0d9884c-b5f6-e9a8-e814-6dfd632466fc-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-11-15 15:08           ` Stanimir Varbanov
2016-11-15 15:08             ` Stanimir Varbanov
     [not found]             ` <ea5858f3-19d6-c746-2e95-a64d6a436b38-NEYub+7Iv8PQT0dZR+AlfA@public.gmane.org>
2016-11-15 16:10               ` Srinivas Kandagatla
2016-11-15 16:10                 ` Srinivas Kandagatla
     [not found]                 ` <8d0e9b19-5d6f-8be5-84be-d102817a6b21-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-11-15 16:30                   ` Stanimir Varbanov
2016-11-15 16:30                     ` Stanimir Varbanov
     [not found] ` <1479122155-13393-1-git-send-email-srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-11-14 11:15   ` [PATCH v4 3/3] PCI: qcom: add runtime pm support to pcie_port Srinivas Kandagatla
2016-11-14 11:15     ` Srinivas Kandagatla

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1479122155-13393-2-git-send-email-srinivas.kandagatla@linaro.org \
    --to=srinivas.kandagatla@linaro.org \
    --cc=bhelgaas@google.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=svarbanov@mm-sol.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.