[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230607124628.157465-3-ulf.hansson@linaro.org>
Date: Wed, 7 Jun 2023 14:46:14 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Sudeep Holla <sudeep.holla@....com>,
Cristian Marussi <cristian.marussi@....com>,
Viresh Kumar <vireshk@...nel.org>, Nishanth Menon <nm@...com>,
Stephen Boyd <sboyd@...nel.org>
Cc: Nikunj Kela <nkela@...cinc.com>,
Prasad Sodagudi <psodagud@...cinc.com>,
Alexandre Torgue <alexandre.torgue@...s.st.com>,
Ulf Hansson <ulf.hansson@...aro.org>, linux-pm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH 02/16] firmware: arm_scmi: Extend perf protocol ops to get the name of a domain
Similar to other protocol ops, it's useful for an scmi module driver to get
the name of a performance domain, hence let's make this available by adding
a new perf protocol callback. Note that, a user is being added from
subsequent changes.
Signed-off-by: Ulf Hansson <ulf.hansson@...aro.org>
---
drivers/firmware/arm_scmi/perf.c | 10 ++++++++++
include/linux/scmi_protocol.h | 3 +++
2 files changed, 13 insertions(+)
diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
index cf7f0de4d6db..5a6ed42bfb55 100644
--- a/drivers/firmware/arm_scmi/perf.c
+++ b/drivers/firmware/arm_scmi/perf.c
@@ -340,6 +340,15 @@ static int scmi_perf_num_domains_get(const struct scmi_protocol_handle *ph)
return pi->num_domains;
}
+static const char *
+scmi_perf_name_get(const struct scmi_protocol_handle *ph, u32 domain)
+{
+ struct scmi_perf_info *pi = ph->get_priv(ph);
+ struct perf_dom_info *dom = pi->dom_info + domain;
+
+ return dom->name;
+}
+
static int scmi_perf_mb_limits_set(const struct scmi_protocol_handle *ph,
u32 domain, u32 max_perf, u32 min_perf)
{
@@ -695,6 +704,7 @@ scmi_power_scale_get(const struct scmi_protocol_handle *ph)
static const struct scmi_perf_proto_ops perf_proto_ops = {
.num_domains_get = scmi_perf_num_domains_get,
+ .name_get = scmi_perf_name_get,
.limits_set = scmi_perf_limits_set,
.limits_get = scmi_perf_limits_get,
.level_set = scmi_perf_level_set,
diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
index 4e42274a68b7..07152a0baee3 100644
--- a/include/linux/scmi_protocol.h
+++ b/include/linux/scmi_protocol.h
@@ -102,6 +102,7 @@ struct scmi_clk_proto_ops {
* by SCMI Performance Protocol
*
* @num_domains_get: gets the number of supported performance domains
+ * @name_get: gets the name of a performance domain
* @limits_set: sets limits on the performance level of a domain
* @limits_get: gets limits on the performance level of a domain
* @level_set: sets the performance level of a domain
@@ -122,6 +123,8 @@ struct scmi_clk_proto_ops {
*/
struct scmi_perf_proto_ops {
int (*num_domains_get)(const struct scmi_protocol_handle *ph);
+ const char *(*name_get)(const struct scmi_protocol_handle *ph,
+ u32 domain);
int (*limits_set)(const struct scmi_protocol_handle *ph, u32 domain,
u32 max_perf, u32 min_perf);
int (*limits_get)(const struct scmi_protocol_handle *ph, u32 domain,
--
2.34.1
Powered by blists - more mailing lists