From 104bbb14b85ed028785907f35b2ef569d7022343 Mon Sep 17 00:00:00 2001 From: Matej Kafka Date: Fri, 23 Jul 2021 04:52:05 +0200 Subject: [PATCH] power_policy: Use new CpufreqPolicy API in imx8 power policies --- src/power_policy/imx8_alternating.hpp | 8 ++++---- src/power_policy/imx8_fixed.hpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/power_policy/imx8_alternating.hpp b/src/power_policy/imx8_alternating.hpp index 82e74b16..c162fd20 100644 --- a/src/power_policy/imx8_alternating.hpp +++ b/src/power_policy/imx8_alternating.hpp @@ -34,11 +34,11 @@ class PowerPolicy_Imx8_Alternating : public PowerPolicy } try { - f1_a53 = a53_pol.available_frequencies->at(std::stoul(a53_f1_str)); - f2_a53 = a53_pol.available_frequencies->at(std::stoul(a53_f2_str)); + f1_a53 = a53_pol.get_freq(std::stoul(a53_f1_str)); + f2_a53 = a53_pol.get_freq(std::stoul(a53_f2_str)); - f1_a72 = a72_pol.available_frequencies->at(std::stoul(a72_f1_str)); - f2_a72 = a72_pol.available_frequencies->at(std::stoul(a72_f2_str)); + f1_a72 = a72_pol.get_freq(std::stoul(a72_f1_str)); + f2_a72 = a72_pol.get_freq(std::stoul(a72_f2_str)); } catch (...) { throw_with_nested( runtime_error("All power policy arguments must be integers in the range <0, 3>")); diff --git a/src/power_policy/imx8_fixed.hpp b/src/power_policy/imx8_fixed.hpp index fa6430bb..f05989a3 100644 --- a/src/power_policy/imx8_fixed.hpp +++ b/src/power_policy/imx8_fixed.hpp @@ -30,8 +30,8 @@ class PowerPolicy_Imx8_Fixed : public PowerPolicy CpuFrequencyHz a53_freq, a72_freq; try { - a53_freq = a53_pol.available_frequencies->at(std::stoul(a53_freq_i)); - a72_freq = a72_pol.available_frequencies->at(std::stoul(a72_freq_i)); + a53_freq = a53_pol.get_freq(std::stoul(a53_freq_i)); + a72_freq = a72_pol.get_freq(std::stoul(a72_freq_i)); } catch (...) { throw runtime_error("Both power policy arguments must be integers in the range <0, 3>"); }