Add support for automatic bq27x00_battery module loading
[qcpufreq] / src / data / scripts / QCPUFreq.helper
1 #!/bin/sh
2 #
3 # This script is part of QCPUFreq
4 # (c)2010 Daniel Klaffenbach
5
6 if [[ -z $1 || -z $2 ]]; then
7         echo "$0 should only be called by QCPUFreq"
8         exit 1
9 fi
10
11 case "$1" in
12     "load_bq27")
13         /sbin/modprobe bq27x00_battery
14         exit 0
15         ;;
16         "set_maxfreq")
17                 #set scaling_max_freq
18                 echo $2 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
19                 exit 0
20                 ;;
21         "set_sr")
22                 #enable or disable SmartReflex
23                 if [ "$2" == "on" ]; then
24                         echo 1 > /sys/power/sr_vdd1_autocomp
25                         #echo 1 > /sys/power/sr_vdd2_autocomp
26                 else
27                         echo 0 > /sys/power/sr_vdd1_autocomp
28                         echo 0 > /sys/power/sr_vdd2_autocomp
29
30                 fi
31                 exit 0
32                 ;;
33         *)
34                 echo "$0 should only be called by QCPUFreq"
35                 exit 1
36                 ;;
37 esac
38