# Lock CPU Frequencies
# Change the clockspeed variable to one of the following values:
# 810000 , 918000 , 1026000 , 1134000 , 1242000 , 1350000 , 1458000 , 1566000 , 1674000 , 1728000
#
# Set to 0 to completely disable the feature and use full clockspeed!
clockspeed=0
case ${clockspeed} in
810000|918000|1026000|1134000|1242000|1350000|1458000|1566000|1674000|1728000)
chmod 666 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo "${clockspeed}" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 444 /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
chmod 666 /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
echo "${clockspeed}" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
chmod 444 /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq
chmod 666 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
echo "${clockspeed}" > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
chmod 444 /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq
chmod 666 /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
echo "${clockspeed}" > /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
chmod 444 /sys/devices/system/cpu/cpu3/cpufreq/scaling_max_freq
;;
0|""|*)
echo "Using Full Clockspeed"
;;
esac