mirror of
https://github.com/ARM-software/devlib.git
synced 2025-03-04 09:17:51 +00:00
cpufreq: add missing get_driver() method
Add a method to read the name of the driver for cpufreq policy for a cpu.
This commit is contained in:
parent
1e839028a1
commit
7e39ecf142
@ -442,6 +442,18 @@ class CpufreqModule(Module):
|
|||||||
|
|
||||||
return [int(c) for c in self.target.read_value(sysfile).split()]
|
return [int(c) for c in self.target.read_value(sysfile).split()]
|
||||||
|
|
||||||
|
@memoized
|
||||||
|
def get_driver(self, cpu):
|
||||||
|
"""
|
||||||
|
Get the name of the driver used by this cpufreq policy.
|
||||||
|
"""
|
||||||
|
if isinstance(cpu, int):
|
||||||
|
cpu = 'cpu{}'.format(cpu)
|
||||||
|
|
||||||
|
sysfile = '/sys/devices/system/cpu/{}/cpufreq/scaling_driver'.format(cpu)
|
||||||
|
|
||||||
|
return self.target.read_value(sysfile).strip()
|
||||||
|
|
||||||
def iter_domains(self):
|
def iter_domains(self):
|
||||||
"""
|
"""
|
||||||
Iterate over the frequency domains in the system
|
Iterate over the frequency domains in the system
|
||||||
|
Loading…
x
Reference in New Issue
Block a user