Skip to content

Commit

Permalink
firmware: arm_scmi: Extend perf protocol ops to get number of domains
Browse files Browse the repository at this point in the history
Similar to other protocol ops, it's useful for an scmi module driver to get
the number of supported performance domains, 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@linaro.org>
Link: https://lore.kernel.org/r/20230825112633.236607-2-ulf.hansson@linaro.org
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
  • Loading branch information
Ulf Hansson authored and Sudeep Holla committed Sep 21, 2023
1 parent 141b4fa commit e9090e7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/firmware/arm_scmi/perf.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,13 @@ scmi_perf_describe_levels_get(const struct scmi_protocol_handle *ph,
return ret;
}

static int scmi_perf_num_domains_get(const struct scmi_protocol_handle *ph)
{
struct scmi_perf_info *pi = ph->get_priv(ph);

return pi->num_domains;
}

static int scmi_perf_msg_limits_set(const struct scmi_protocol_handle *ph,
u32 domain, u32 max_perf, u32 min_perf)
{
Expand Down Expand Up @@ -948,6 +955,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,
.limits_set = scmi_perf_limits_set,
.limits_get = scmi_perf_limits_get,
.level_set = scmi_perf_level_set,
Expand Down
2 changes: 2 additions & 0 deletions include/linux/scmi_protocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ struct scmi_clk_proto_ops {
* struct scmi_perf_proto_ops - represents the various operations provided
* by SCMI Performance Protocol
*
* @num_domains_get: gets the number of supported performance domains
* @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
Expand All @@ -129,6 +130,7 @@ struct scmi_clk_proto_ops {
* or in some other (abstract) scale
*/
struct scmi_perf_proto_ops {
int (*num_domains_get)(const struct scmi_protocol_handle *ph);
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,
Expand Down

0 comments on commit e9090e7

Please sign in to comment.