mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 02:00:45 +00:00
module/cpuidle: Add fallback for reading governor
As per #407 if the kernel is compiled with the ability to switch cpuidle governors via sysfs `current_governor_ro` is replaced with `current_governor` so check if the intial path exists before reading.
This commit is contained in:
parent
0c434e8a1b
commit
88f8c9e9ac
@ -173,4 +173,7 @@ class Cpuidle(Module):
|
|||||||
return self.target.read_value(self.target.path.join(self.root_path, 'current_driver'))
|
return self.target.read_value(self.target.path.join(self.root_path, 'current_driver'))
|
||||||
|
|
||||||
def get_governor(self):
|
def get_governor(self):
|
||||||
return self.target.read_value(self.target.path.join(self.root_path, 'current_governor_ro'))
|
path = self.target.path.join(self.root_path, 'current_governor_ro')
|
||||||
|
if not self.target.path.exist(path):
|
||||||
|
path = self.target.path.join(self.root_path, 'current_governor')
|
||||||
|
return self.target.read_value(path)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user