| #!/system/bin/sh |
| # Copyright (C) 2012 Linaro Limited |
| |
| # Author: Linaro Validation Team <linaro-dev@lists.linaro.org> |
| # |
| # This program is free software: you can redistribute it and/or modify |
| # it under the terms of the GNU General Public License as published by |
| # the Free Software Foundation, either version 3 of the License, or |
| # (at your option) any later version. |
| # |
| # This program is distributed in the hope that it will be useful, |
| # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| # GNU General Public License for more details. |
| # |
| # You should have received a copy of the GNU General Public License |
| # along with this program. If not, see <http://www.gnu.org/licenses/>. |
| |
| insmod /system/modules/arm-bl-cpufreq.ko |
| basepath=/sys/devices/system/cpu |
| |
| list=`cat $basepath/cpu0/cpufreq/scaling_available_governors` |
| |
| case " $list" in |
| *" $1 "*) |
| for c in `find $basepath -name 'cpu?' -type d`; do |
| echo $1 > $c/cpufreq/scaling_governor; |
| done;; |
| *) |
| echo "Usage: $0 <$(echo $list|sed 's/ /|/g')>"; |
| echo "" |
| echo "Current state:" |
| for c in `find $basepath -name 'cpu?' -type d`; do |
| echo $c: $(cat $c/cpufreq/scaling_governor); |
| done; |
| exit 0;; |
| esac |