2
* Copyright 2013 Canonical Ltd.
4
* This file is part of powerd.
6
* powerd is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 3.
10
* powerd is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
21
#include "libsuspend.h"
24
const struct suspend_handler *handler;
26
void libsuspend_init(int force_mock)
29
handler = autosleep_detect();
33
handler = earlysuspend_detect();
37
handler = legacy_detect();
41
printf("No suspend interface detected, using mock suspend\n");
44
handler = mocksuspend_detect();
47
int libsuspend_prepare_suspend(void)
53
return handler->prepare();
58
int libsuspend_enter_suspend(void)
64
return handler->enter();
69
int libsuspend_exit_suspend(void)
75
return handler->exit();