mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
cpufreq: Add methods to retrieve max/min available frequencies for a cpu
Adds usability methods methods to allow easy retrieval of the maximum and minimum frequencies available for a given cpu
This commit is contained in:
parent
1d9dc42af5
commit
55762edf19
@ -193,6 +193,24 @@ class CpufreqModule(Module):
|
||||
available_frequencies = map(int, reversed([f for f, _ in zip(out_iter, out_iter)]))
|
||||
return available_frequencies
|
||||
|
||||
@memoized
|
||||
def get_max_available_frequency(self, cpu):
|
||||
"""
|
||||
Returns the maximum available frequency for a given core or None if
|
||||
could not be found.
|
||||
"""
|
||||
freqs = self.list_frequencies(cpu)
|
||||
return freqs and max(freqs) or None
|
||||
|
||||
@memoized
|
||||
def get_min_available_frequency(self, cpu):
|
||||
"""
|
||||
Returns the minimum available frequency for a given core or None if
|
||||
could not be found.
|
||||
"""
|
||||
freqs = self.list_frequencies(cpu)
|
||||
return freqs and min(freqs) or None
|
||||
|
||||
def get_min_frequency(self, cpu):
|
||||
"""
|
||||
Returns the min frequency currently set for the specified CPU.
|
||||
|
Loading…
x
Reference in New Issue
Block a user