@@ -440,6 +440,15 @@ static int scmi_perf_limits_get(const struct scmi_protocol_handle *ph,
return scmi_perf_mb_limits_get(ph, domain, max_perf, min_perf);
}
+static bool
+scmi_perf_can_level_set(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->set_perf;
+}
+
static int scmi_perf_mb_level_set(const struct scmi_protocol_handle *ph,
u32 domain, u32 level, bool poll)
{
@@ -707,6 +716,7 @@ static const struct scmi_perf_proto_ops perf_proto_ops = {
.name_get = scmi_perf_name_get,
.limits_set = scmi_perf_limits_set,
.limits_get = scmi_perf_limits_get,
+ .can_level_set = scmi_perf_can_level_set,
.level_set = scmi_perf_level_set,
.level_get = scmi_perf_level_get,
.device_domain_id = scmi_dev_domain_id,
@@ -129,6 +129,7 @@ struct scmi_perf_proto_ops {
u32 max_perf, u32 min_perf);
int (*limits_get)(const struct scmi_protocol_handle *ph, u32 domain,
u32 *max_perf, u32 *min_perf);
+ bool (*can_level_set)(const struct scmi_protocol_handle *ph, u32 domain);
int (*level_set)(const struct scmi_protocol_handle *ph, u32 domain,
u32 level, bool poll);
int (*level_get)(const struct scmi_protocol_handle *ph, u32 domain,
As a subsequent change show, it's useful for an scmi module driver to know if a performance domain can support the set level operation, hence let's make this available by adding a new perf protocol callback. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> --- drivers/firmware/arm_scmi/perf.c | 10 ++++++++++ include/linux/scmi_protocol.h | 1 + 2 files changed, 11 insertions(+)