Lisa Nguyen | adf9df9 | 2015-01-25 18:16:45 -0800 | [diff] [blame] | 1 | #!/bin/sh |
Sanjay Singh Rawat | 2f7295d | 2013-08-21 18:19:42 +0530 | [diff] [blame] | 2 | # |
| 3 | # PM-QA validation test suite for the power management on Linux |
| 4 | # |
| 5 | # Copyright (C) 2013, Linaro Limited. |
| 6 | # |
| 7 | # This program is free software; you can redistribute it and/or |
| 8 | # modify it under the terms of the GNU General Public License |
| 9 | # as published by the Free Software Foundation; either version 2 |
| 10 | # of the License, or (at your option) any later version. |
| 11 | # |
| 12 | # This program is distributed in the hope that it will be useful, |
| 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | # GNU General Public License for more details. |
| 16 | # |
| 17 | # You should have received a copy of the GNU General Public License |
| 18 | # along with this program; if not, write to the Free Software |
| 19 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
| 20 | # |
| 21 | # Contributors: |
| 22 | # Sanjay Singh Rawat <sanjay.rawat@linaro.org> (LG Electronics) |
| 23 | # - initial API and implementation |
| 24 | # |
| 25 | |
| 26 | # URL : https://wiki.linaro.org/WorkingGroups/PowerManagement/Doc/QA/Scripts#thermal_00 |
| 27 | |
Lisa Nguyen | adf9df9 | 2015-01-25 18:16:45 -0800 | [diff] [blame] | 28 | . ../include/functions.sh |
Sanjay Singh Rawat | 2f7295d | 2013-08-21 18:19:42 +0530 | [diff] [blame] | 29 | |
| 30 | check_cooling_device_type() { |
Lisa Nguyen | 4e0b59a | 2015-01-25 17:46:40 -0800 | [diff] [blame] | 31 | all_zones=$(ls $THERMAL_PATH | grep "cooling_device['$MAX_CDEV']") |
Lisa Nguyen | fb1103c | 2015-10-31 03:09:43 -0700 | [diff] [blame] | 32 | echo "Cooling Device list" |
| 33 | echo "-------------------" |
| 34 | if [ -z "$all_zones" ]; then |
| 35 | echo "- None" |
| 36 | else |
| 37 | for i in $all_zones; do |
| 38 | type=$(cat $THERMAL_PATH/$i/type) |
| 39 | echo $i |
| 40 | echo "- $type" |
| 41 | done |
| 42 | fi |
| 43 | echo "\n" |
Sanjay Singh Rawat | 2f7295d | 2013-08-21 18:19:42 +0530 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | check_thermal_zone_type() { |
Lisa Nguyen | 4e0b59a | 2015-01-25 17:46:40 -0800 | [diff] [blame] | 47 | all_zones=$(ls $THERMAL_PATH | grep "thermal_zone['$MAX_ZONE']") |
Lisa Nguyen | fb1103c | 2015-10-31 03:09:43 -0700 | [diff] [blame] | 48 | echo "Thermal Zone list" |
| 49 | echo "-----------------" |
| 50 | if [ -z "$all_zones" ]; then |
| 51 | echo "- None" |
| 52 | else |
| 53 | for i in $all_zones; do |
| 54 | type=$(cat $THERMAL_PATH/$i/type) |
| 55 | echo $i |
| 56 | echo "- $type" |
| 57 | done |
| 58 | fi |
| 59 | echo "\n" |
Sanjay Singh Rawat | 2f7295d | 2013-08-21 18:19:42 +0530 | [diff] [blame] | 60 | } |
| 61 | |
Lisa Nguyen | fb1103c | 2015-10-31 03:09:43 -0700 | [diff] [blame] | 62 | check_thermal_zone_type |
| 63 | check_cooling_device_type |