1
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2024-11-24 21:56:19 +00:00
Lakka-LibreELEC/projects/RPi/packages/systemd/scripts/cpufreq
Ian Leonard db6ebeedbf rpi: use systemd for cpufreq tuning
Signed-off-by: Ian Leonard <antonlacon@gmail.com>
2019-10-28 15:55:22 +00:00

19 lines
704 B
Bash
Executable File

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2009-2015 Stephan Raue (stephan@openelec.tv)
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
SYS_CPUFREQ_GOV=$( cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor )
SYS_ONDEMAND_DIR="/sys/devices/system/cpu/cpufreq/ondemand/"
# Configure frequency scaling properties
if [ "${SYS_CPUFREQ_GOV}" = "ondemand" ]; then
echo 1 > "${SYS_ONDEMAND_DIR}/io_is_busy"
echo 50 > "${SYS_ONDEMAND_DIR}/up_threshold"
echo 100000 > "${SYS_ONDEMAND_DIR}/sampling_rate"
echo 50 > "${SYS_ONDEMAND_DIR}/sampling_down_factor"
else
echo "cpufreq: settings not found for current cpu governor." | systemd-cat -p info
fi