1
0
mirror of https://github.com/ARM-software/devlib.git synced 2025-01-31 10:10:46 +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:
Marc Bonnici 2019-07-30 09:38:54 +01:00 committed by setrofim
parent 0c434e8a1b
commit 88f8c9e9ac

View File

@ -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)