Fix bug in RG552 sleep, and add sleep freq set to RK3326 build
This commit is contained in:
parent
111c5841b6
commit
27710357c0
3 changed files with 43 additions and 1 deletions
|
@ -11,7 +11,7 @@ CUR_CPU_FREQ="$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor)"
|
|||
CUR_GPU_FREQ="$(cat /sys/devices/platform/ff9a0000.gpu/devfreq/ff9a0000.gpu/governor)"
|
||||
|
||||
set_setting sleep.cpugovernor "${CUR_CPU_FREQ}"
|
||||
set_setting sleep.cpugovernor "${CUR_GPU_FREQ}"
|
||||
set_setting sleep.gpugovernor "${CUR_GPU_FREQ}"
|
||||
|
||||
### Set all governors to powersave
|
||||
set_cpu_gov powersave
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
### Restore previous governors before going to sleep
|
||||
|
||||
. /etc/profile
|
||||
|
||||
### Grab the old governors.
|
||||
OLD_CPU_FREQ=$(get_setting "sleep.cpugovernor")
|
||||
if [ ! -n "${OLD_CPU_FREQ}" ]; then
|
||||
OLD_CPU_FREQ="schedutil"
|
||||
fi
|
||||
|
||||
OLD_GPU_FREQ=$(get_setting "sleep.gpugovernor")
|
||||
if [ ! -n "${OLD_GPU_FREQ}" ]; then
|
||||
OLD_GPU_FREQ="simple_ondemand"
|
||||
fi
|
||||
|
||||
# Restore old governors.
|
||||
set_cpu_gov "${OLD_CPU_FREQ}"
|
||||
set_dmc_gov "${OLD_CPU_FREQ}"
|
||||
set_gpu_gov "${OLD_GPU_FREQ}"
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2023 JELOS (https://github.com/JustEnoughLinuxOS)
|
||||
|
||||
# Store current freq governors and set governors to powersave.
|
||||
|
||||
. /etc/profile
|
||||
|
||||
### Get the current cpu and gpu governor, save for when the device wakes from sleep.
|
||||
CUR_CPU_FREQ="$(cat /sys/devices/system/cpu/cpufreq/policy0/scaling_governor)"
|
||||
CUR_GPU_FREQ="$(cat /sys/devices/platform/ff400000.gpu/devfreq/ff400000.gpu/governor)"
|
||||
|
||||
set_setting sleep.cpugovernor "${CUR_CPU_FREQ}"
|
||||
set_setting sleep.gpugovernor "${CUR_GPU_FREQ}"
|
||||
|
||||
### Set all governors to powersave
|
||||
set_cpu_gov powersave
|
||||
set_dmc_gov powersave
|
||||
set_gpu_gov powersave
|
Loading…
Reference in a new issue