diff --git a/pm/pm-functions.in b/pm/pm-functions.in --- a/pm/pm-functions.in +++ b/pm/pm-functions.in @@ -317,6 +317,20 @@ if [ -z "$HIBERNATE_MODULE" ] && \ } fi +# for kernels that support suspend to both (i.e. hybrid suspend) +# since kernel 3.6 +if [ -z "$SUSPEND_HYBRID_MODULE" ] && \ + [ -f /sys/power/disk ] && \ + grep -q disk /sys/power/state && \ + grep -q suspend /sys/power/disk; then + SUSPEND_HYBRID_MODULE="kernel" + do_suspend_hybrid() + { + HIBERNATE_MODE="suspend" + do_hibernate + } +fi + # since the kernel does not directly support hybrid sleep, we do # something else -- suspend and schedule an alarm to go into # hibernate if we have slept long enough.