firmware: arm_scmi: Add power_scale_mw_get() interface
authorLukasz Luba <lukasz.luba@arm.com>
Tue, 24 Nov 2020 10:43:45 +0000 (10:43 +0000)
committerViresh Kumar <viresh.kumar@linaro.org>
Tue, 8 Dec 2020 04:46:13 +0000 (10:16 +0530)
Add a new interface to the existing perf_ops and export the information
about the power values scale.

This would be used by the cpufreq driver and Energy Model framework to
set the performance domains scale: milli-Watts or abstract scale.

Suggested-by: Morten Rasmussen <morten.rasmussen@arm.com>
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
drivers/firmware/arm_scmi/perf.c
include/linux/scmi_protocol.h

index 82fb3ba..e374b11 100644 (file)
@@ -750,6 +750,13 @@ static bool scmi_fast_switch_possible(const struct scmi_handle *handle,
        return dom->fc_info && dom->fc_info->level_set_addr;
 }
 
+static bool scmi_power_scale_mw_get(const struct scmi_handle *handle)
+{
+       struct scmi_perf_info *pi = handle->perf_priv;
+
+       return pi->power_scale_mw;
+}
+
 static const struct scmi_perf_ops perf_ops = {
        .limits_set = scmi_perf_limits_set,
        .limits_get = scmi_perf_limits_get,
@@ -762,6 +769,7 @@ static const struct scmi_perf_ops perf_ops = {
        .freq_get = scmi_dvfs_freq_get,
        .est_power_get = scmi_dvfs_est_power_get,
        .fast_switch_possible = scmi_fast_switch_possible,
+       .power_scale_mw_get = scmi_power_scale_mw_get,
 };
 
 static int scmi_perf_set_notify_enabled(const struct scmi_handle *handle,
index 9cd312a..c77e4e1 100644 (file)
@@ -121,6 +121,7 @@ struct scmi_perf_ops {
                             unsigned long *rate, unsigned long *power);
        bool (*fast_switch_possible)(const struct scmi_handle *handle,
                                     struct device *dev);
+       bool (*power_scale_mw_get)(const struct scmi_handle *handle);
 };
 
 /**