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
Cc: rnayak@codeaurora.org, bjorn.andersson@linaro.org,
linux-kernel@vger.kernel.org, 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 2/6] drivers: qcom: rpmh: export controller idle status
Date: Thu, 19 Jul 2018 14:49:31 +0530 [thread overview]
Message-ID: <1531991975-23665-3-git-send-email-rplsssn@codeaurora.org> (raw)
In-Reply-To: <1531991975-23665-1-git-send-email-rplsssn@codeaurora.org>
From: Lina Iyer <ilina@codeaurora.org>
Allow the controller state be read by platform drivers. This is useful
for PM drivers which can choose to disallow idle modes when the
controller is busy.
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
---
drivers/soc/qcom/rpmh.c | 13 +++++++++++++
include/soc/qcom/rpmh.h | 5 +++++
2 files changed, 18 insertions(+)
diff --git a/drivers/soc/qcom/rpmh.c b/drivers/soc/qcom/rpmh.c
index c7beb68..2382276 100644
--- a/drivers/soc/qcom/rpmh.c
+++ b/drivers/soc/qcom/rpmh.c
@@ -511,3 +511,16 @@ int rpmh_invalidate(const struct device *dev)
return ret;
}
EXPORT_SYMBOL(rpmh_invalidate);
+
+/**
+ * rpmh_ctrlr_idle: Return the controller idle status
+ *
+ * @dev: the device making the request
+ */
+int rpmh_ctrlr_idle(const struct device *dev)
+{
+ struct rpmh_ctrlr *ctrlr = get_rpmh_ctrlr(dev);
+
+ return rpmh_rsc_ctrlr_is_idle(ctrlr_to_drv(ctrlr));
+}
+EXPORT_SYMBOL(rpmh_ctrlr_idle);
diff --git a/include/soc/qcom/rpmh.h b/include/soc/qcom/rpmh.h
index 619e07c..d445322 100644
--- a/include/soc/qcom/rpmh.h
+++ b/include/soc/qcom/rpmh.h
@@ -24,6 +24,8 @@ int rpmh_write_batch(const struct device *dev, enum rpmh_state state,
int rpmh_invalidate(const struct device *dev);
+int rpmh_ctrlr_idle(const struct device *dev);
+
#else
static inline int rpmh_write(const struct device *dev, enum rpmh_state state,
@@ -46,6 +48,9 @@ static inline int rpmh_flush(const struct device *dev)
static inline int rpmh_invalidate(const struct device *dev)
{ return -ENODEV; }
+static inline int rpmh_ctrlr_idle(const struct device *dev)
+{ return -ENODEV; }
+
#endif /* CONFIG_QCOM_RPMH */
#endif /* __SOC_QCOM_RPMH_H__ */
--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project
next prev parent reply other threads:[~2018-07-19 9:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-19 9:19 [PATCH 0/6] drivers/qcom: add additional functionality to RPMH Raju P L S S S N
2018-07-19 9:19 ` [PATCH 1/6] drivers: qcom: rpmh-rsc: return if the controller is idle Raju P L S S S N
2018-07-19 9:19 ` Raju P L S S S N [this message]
2018-07-19 9:19 ` [PATCH 3/6] drivers: qcom: rpmh: disallow active requests in solver mode Raju P L S S S N
2018-07-19 9:19 ` [PATCH 4/6] drivers: qcom: rpmh-rsc: clear active mode configuration for waketcs Raju P L S S S N
2018-07-19 9:19 ` [PATCH 5/6] drivers: qcom: rpmh-rsc: write PDC data Raju P L S S S N
2018-07-19 9:19 ` [PATCH 6/6] drivers: qcom: rpmh: " 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=1531991975-23665-3-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=evgreen@chromium.org \
--cc=ilina@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-soc@vger.kernel.org \
--cc=mka@chromium.org \
--cc=rnayak@codeaurora.org \
--cc=sboyd@kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).