/
lkconfig
executable file
·115 lines (110 loc) · 3.06 KB
/
lkconfig
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/system/bin/sh
detectsu=`ls /data/data`
[ -z "$detectsu" ] && echo "Must be superuser!" && exit
while true; do
echo
echo "leanKernel configurator"
echo "---"
echo "0) display current settings"
echo "1) panel temperature"
echo "2) panel color"
echo "3) set screen_off_maxfreq"
echo "4) set cpu max frequency"
echo "5) gpu governor"
echo "6) MMC CRC"
echo
echo "9) restart mpdecision (to fix stuck cores)"
echo
echo -n "please enter a number (or press enter to exit): "
read option
case $option in
0)
echo
echo "current settings"
echo "----------------"
echo -n "1) panel temperature: "
cat /sys/class/lcd/panel/temperature
echo -n "2) panel color: "
cat /sys/class/lcd/panel/panel_colors
echo -n "3) screen off maxfreq: "
cat `ls -d /sys/devices/system/cpu/cpufreq/*a*`/screen_off_maxfreq
echo -n "4) cpu max frequency: "
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo -n "5) gpu governor: "
cat /sys/devices/fdb00000.qcom,kgsl-3d0/devfreq/fdb00000.qcom,kgsl-3d0/governor
echo -n "6) MMC CRC: "
cat /sys/module/mmc_core/parameters/use_spi_crc
echo
;;
1)
echo -n "Enter a number between -60 and 0 (0 is kernel default): "
read value
echo $value > /data/data/leankernel/paneltemp
echo $value > /sys/class/lcd/panel/temperature
echo "Done! (also will persist at boot)"
;;
2)
echo -n "Enter a number between 0 and 4 (2 is kernel default): "
read value
echo $value > /data/data/leankernel/panelcolor
echo $value > /sys/class/lcd/panel/panel_colors
echo "Turn off screen and back on (also will persist at boot)"
;;
3)
echo -n "Enter a number between 0 and 4 (0:650mhz,1:883mhz,2:1.2ghz/default,3:1.5ghz,4:disable): "
read value
case $value in
0) FREQ=652800;;
1) FREQ=883200;;
2) FREQ=1267200;;
3) FREQ=1574400;;
4) FREQ=2265600;;
esac
echo $FREQ > /data/data/leankernel/screen_off_maxfreq
echo $FREQ > `ls -d /sys/devices/system/cpu/cpufreq/*a*`/screen_off_maxfreq
echo "Done! (also will persist at boot)"
;;
4)
echo -n "Enter a number between 0 and 2 (0:2.2ghz,1:2.5ghz,2:2.7ghz): "
read value
case $value in
0) FREQ=2265600;;
1) FREQ=2496000;;
2) FREQ=2726400;;
esac
echo $FREQ > /data/data/leankernel/scaling_max_freq
echo $FREQ > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo "Done! (also will persist at boot)"
;;
5)
echo -n "Enter a number between 0 and 3 (0:adreno-tz/default,1:powersave,2:performance,3:ondemand): "
read value
case $value in
0) GOV=msm-adreno-tz;;
1) GOV=powersave;;
2) GOV=performance;;
3) GOV=simple_ondemand;;
esac
echo $GOV > /data/data/leankernel/gpu_governor
echo $GOV > /sys/devices/fdb00000.qcom,kgsl-3d0/devfreq/fdb00000.qcom,kgsl-3d0/governor
echo "Done! (also will persist at boot)"
;;
6)
echo -n "Enter Y to enable, N to disable MMC CRC: "
read value
echo $value > /data/data/leankernel/use_spi_crc
echo $value > /sys/module/mmc_core/parameters/use_spi_crc
echo "Done! (also will persist at boot)"
;;
9)
stop mpdecision
sleep 2
start mpdecision
echo "mpdecision restarted."
;;
*)
exit
;;
esac
echo
done