Skip to content
Snippets Groups Projects
Commit 0f4c52d9 authored by Martin Kepplinger's avatar Martin Kepplinger
Browse files

power_key: adjust devfreq sysfs naming to linux 5.6

Linux changes the sysfs naming of devfreq from what we currently use, see
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=66d0e797bf095d407479c89952d42b1d96ef0a7f



Signed-off-by: default avatarMartin Kepplinger <martin.kepplinger@puri.sm>
parent 9bfad96e
No related branches found
No related tags found
No related merge requests found
......@@ -21,8 +21,19 @@ def check_screen():
return True
def find_dram_devfreq():
for node in ['devfreq0', '3d400000.memory-controller']:
dram = "/sys/class/devfreq/{}".format(node)
if os.path.isdir(dram):
break
return dram
set_freq = os.path.join(find_dram_devfreq(), 'userspace/set_freq')
def set_dram_freq(freq):
speedF = open("/sys/class/devfreq/devfreq0/userspace/set_freq", "w+")
speedF = open(set_freq, "w+")
speedF.write(freq + "\n")
speedF.close()
......@@ -40,7 +51,7 @@ def main(args):
foundpath = ''.join(path)
dev = InputDevice(foundpath)
f = open("/sys/class/devfreq/devfreq0/governor", "w+")
f = open(os.path.join(find_dram_devfreq(), 'governor'), "w+")
f.write("userspace\n")
f.close()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment