[PATCH 4/4] firmware: arm_scmi/perf: Mark sustainable OPP

Lukasz Luba
2020-10-28T22:27:21Z

Mark sustainable OPP frequency based on previously received value from
the firmware.

Signed-off-by: Lukasz Luba <lukasz.luba@arm.com>
---
drivers/firmware/arm_scmi/perf.c | 10 ++++++++++
1 file changed, 10 insertions(+)

diff --git a/drivers/firmware/arm_scmi/perf.c b/drivers/firmware/arm_scmi/perf.c
index 82fb3babff72..a8f3fa1d7f1e 100644
--- a/drivers/firmware/arm_scmi/perf.c
+++ b/drivers/firmware/arm_scmi/perf.c
@@ -669,6 +669,16 @@ static int scmi_dvfs_device_opps_add(const struct scmi_handle *handle,
return ret;
}
}
+
+ if (dom->sustained_freq_khz) {
+ /* The sustained frequency is always in kHz */
+ freq = dom->sustained_freq_khz * 1000;
+ ret = dev_pm_opp_set_sustainable_opp_freq(dev, freq);
+ if (ret)
+ dev_warn(dev, "failed to add sustainable freq=%lu %d\n",
+ freq, ret);
+ }
+
return 0;
}

--
2.17.1