All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Raju P.L.S.S.S.N" <rplsssn@codeaurora.org>
To: andy.gross@linaro.org, david.brown@linaro.org,
	linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org,
	linux-pm@vger.kernel.org
Cc: rnayak@codeaurora.org, bjorn.andersson@linaro.org,
	linux-kernel@vger.kernel.org, lorenzo.pieralisi@arm.com,
	rafael@kernel.org, drake@endlessm.com, sboyd@kernel.org,
	evgreen@chromium.org, dianders@chromium.org, mka@chromium.org,
	ilina@codeaurora.org, "Raju P.L.S.S.S.N" <rplsssn@codeaurora.org>
Subject: [PATCH RFC 3/6] drivers: qcom: system_pm: Add power management ops
Date: Sat, 25 Aug 2018 01:36:25 +0530	[thread overview]
Message-ID: <1535141188-29731-4-git-send-email-rplsssn@codeaurora.org> (raw)
In-Reply-To: <1535141188-29731-1-git-send-email-rplsssn@codeaurora.org>

Add suspend power management ops so that the sleep & wake resource
requests are flushed to corresponding TCS. The firmware would ensure
that the buffered requests in TCS are sent to Resource Power Manager
during entry to deepest low power modes.

Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
---
 drivers/soc/qcom/Kconfig     |  2 +-
 drivers/soc/qcom/system_pm.c | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/drivers/soc/qcom/Kconfig b/drivers/soc/qcom/Kconfig
index a52abe9..ac0e413 100644
--- a/drivers/soc/qcom/Kconfig
+++ b/drivers/soc/qcom/Kconfig
@@ -88,7 +88,7 @@ config QCOM_RPMH
 
 config QCOM_SYSTEM_PM
 	bool "Qualcomm System PM"
-	depends on CPU_PM && QCOM_RPMH
+	depends on CPU_PM && PM_SLEEP && QCOM_RPMH
 	help
 	  Support for QCOM platform system power management to perform tasks
 	  necessary while application processor votes for deeper modes so that
diff --git a/drivers/soc/qcom/system_pm.c b/drivers/soc/qcom/system_pm.c
index 40e5aa7..8810b84 100644
--- a/drivers/soc/qcom/system_pm.c
+++ b/drivers/soc/qcom/system_pm.c
@@ -67,6 +67,23 @@ static int sys_pm_probe(struct platform_device *pdev)
 	return 0;
 }
 
+static int sys_pm_suspend(struct device *dev)
+{
+	if (rpmh_ctrlr_idle(dev)) {
+		/* Flush the sleep/wake sets in RSC controller */
+		rpmh_flush(dev);
+	} else {
+		pr_err("%s:rpmh controller is busy\n", __func__);
+		return -EBUSY;
+	}
+
+	return 0;
+}
+
+static const struct dev_pm_ops sys_pm_dev_pm_ops = {
+	SET_LATE_SYSTEM_SLEEP_PM_OPS(sys_pm_suspend, NULL)
+};
+
 static const struct of_device_id sys_pm_drv_match[] = {
 	{ .compatible = "qcom,system-pm", },
 	{ }
@@ -77,6 +94,7 @@ static int sys_pm_probe(struct platform_device *pdev)
 	.driver = {
 		.name = KBUILD_MODNAME,
 		.of_match_table = sys_pm_drv_match,
+		.pm = &sys_pm_dev_pm_ops,
 	},
 };
 builtin_platform_driver(sys_pm_driver);
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation.

  parent reply	other threads:[~2018-08-24 20:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-24 20:06 [PATCH RFC 0/6] drivers: qcom: enable system low power modes for SDM845 Raju P.L.S.S.S.N
2018-08-24 20:06 ` [PATCH RFC 1/6] drivers: qcom: system_pm: add system PM client for RPMH based SoCs Raju P.L.S.S.S.N
2018-08-24 20:06 ` [PATCH RFC 2/6] dt-bindings: introduce System PM bindings for Qualcomm SoCs Raju P.L.S.S.S.N
2018-09-04 13:14   ` Rob Herring
2018-08-24 20:06 ` Raju P.L.S.S.S.N [this message]
2018-08-24 20:06 ` [PATCH RFC 4/6] drivers: qcom: system_pm: program next wakeup to PDC timer Raju P.L.S.S.S.N
2018-08-24 20:06 ` [PATCH RFC 5/6] drivers: qcom: rpmh: force flush new sleep/wake requests during suspend Raju P.L.S.S.S.N
2018-08-24 20:06 ` [PATCH RFC 6/6] drivers: soc: system_pm: Add suspend notifier Raju P.L.S.S.S.N

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=1535141188-29731-4-git-send-email-rplsssn@codeaurora.org \
    --to=rplsssn@codeaurora.org \
    --cc=andy.gross@linaro.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=david.brown@linaro.org \
    --cc=dianders@chromium.org \
    --cc=drake@endlessm.com \
    --cc=evgreen@chromium.org \
    --cc=ilina@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-soc@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mka@chromium.org \
    --cc=rafael@kernel.org \
    --cc=rnayak@codeaurora.org \
    --cc=sboyd@kernel.org \
    --subject='Re: [PATCH RFC 3/6] drivers: qcom: system_pm: Add power management ops' \
    /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

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.