Commit 0b631ed3 authored by Shreeya Patel's avatar Shreeya Patel Committed by Shuah Khan

kselftest: cpufreq: Add RTC wakeup alarm

Add RTC wakeup alarm for devices to resume after specific time interval.
This improvement in the test will help in enabling this test
in the CI systems and will eliminate the need of manual intervention
for resuming back the devices after suspend/hibernation.
Signed-off-by: default avatarShreeya Patel <shreeya.patel@collabora.com>
Acked-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
parent 37ee7d19
...@@ -231,6 +231,21 @@ do_suspend() ...@@ -231,6 +231,21 @@ do_suspend()
for i in `seq 1 $2`; do for i in `seq 1 $2`; do
printf "Starting $1\n" printf "Starting $1\n"
if [ "$3" = "rtc" ]; then
if ! command -v rtcwake &> /dev/null; then
printf "rtcwake could not be found, please install it.\n"
return 1
fi
rtcwake -m $filename -s 15
if [ $? -ne 0 ]; then
printf "Failed to suspend using RTC wake alarm\n"
return 1
fi
fi
echo $filename > $SYSFS/power/state echo $filename > $SYSFS/power/state
printf "Came out of $1\n" printf "Came out of $1\n"
......
...@@ -24,6 +24,8 @@ helpme() ...@@ -24,6 +24,8 @@ helpme()
[-t <basic: Basic cpufreq testing [-t <basic: Basic cpufreq testing
suspend: suspend/resume, suspend: suspend/resume,
hibernate: hibernate/resume, hibernate: hibernate/resume,
suspend_rtc: suspend/resume back using the RTC wakeup alarm,
hibernate_rtc: hibernate/resume back using the RTC wakeup alarm,
modtest: test driver or governor modules. Only to be used with -d or -g options, modtest: test driver or governor modules. Only to be used with -d or -g options,
sptest1: Simple governor switch to produce lockdep. sptest1: Simple governor switch to produce lockdep.
sptest2: Concurrent governor switch to produce lockdep. sptest2: Concurrent governor switch to produce lockdep.
...@@ -76,7 +78,8 @@ parse_arguments() ...@@ -76,7 +78,8 @@ parse_arguments()
helpme helpme
;; ;;
t) # --func_type (Function to perform: basic, suspend, hibernate, modtest, sptest1/2/3/4 (default: basic)) t) # --func_type (Function to perform: basic, suspend, hibernate,
# suspend_rtc, hibernate_rtc, modtest, sptest1/2/3/4 (default: basic))
FUNC=$OPTARG FUNC=$OPTARG
;; ;;
...@@ -121,6 +124,14 @@ do_test() ...@@ -121,6 +124,14 @@ do_test()
do_suspend "hibernate" 1 do_suspend "hibernate" 1
;; ;;
"suspend_rtc")
do_suspend "suspend" 1 rtc
;;
"hibernate_rtc")
do_suspend "hibernate" 1 rtc
;;
"modtest") "modtest")
# Do we have modules in place? # Do we have modules in place?
if [ -z $DRIVER_MOD ] && [ -z $GOVERNOR_MOD ]; then if [ -z $DRIVER_MOD ] && [ -z $GOVERNOR_MOD ]; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment