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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Lukasz Luba <lukasz.luba@xxxxxxx>
---
 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




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux