summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Cross2012-05-03 19:30:16 -0500
committerColin Cross2012-05-07 17:33:34 -0500
commita2582c2c4d20684b21aaf50913a27239789bf5eb (patch)
treee55a928fad07633045e5574e84f3cee782300a05 /libsuspend/include
parentf82e74116314c4def32013495337c038f6c6ee6c (diff)
downloadplatform-system-core-a2582c2c4d20684b21aaf50913a27239789bf5eb.tar.gz
platform-system-core-a2582c2c4d20684b21aaf50913a27239789bf5eb.tar.xz
platform-system-core-a2582c2c4d20684b21aaf50913a27239789bf5eb.zip
libsuspend: create new library to handle triggering suspend
libsuspend provides functions autosuspend_enable() and autosuspend_disable() to trigger suspend on a variety of different kernels. Change-Id: I5dc28fb51532fa7c514330f1cfde7698d31d734c
Diffstat (limited to 'libsuspend/include')
-rw-r--r--libsuspend/include/suspend/autosuspend.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/libsuspend/include/suspend/autosuspend.h b/libsuspend/include/suspend/autosuspend.h
new file mode 100644
index 000000000..f56fc6acb
--- /dev/null
+++ b/libsuspend/include/suspend/autosuspend.h
@@ -0,0 +1,48 @@
1/*
2 * Copyright (C) 2012 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef _LIBSUSPEND_AUTOSUSPEND_H_
18#define _LIBSUSPEND_AUTOSUSPEND_H_
19
20#include <sys/cdefs.h>
21
22__BEGIN_DECLS
23
24/*
25 * autosuspend_enable
26 *
27 * Turn on autosuspend in the kernel, allowing it to enter suspend if no
28 * wakelocks/wakeup_sources are held.
29 *
30 *
31 *
32 * Returns 0 on success, -1 if autosuspend was not enabled.
33 */
34int autosuspend_enable(void);
35
36/*
37 * autosuspend_disable
38 *
39 * Turn off autosuspend in the kernel, preventing suspend and synchronizing
40 * with any in-progress resume.
41 *
42 * Returns 0 on success, -1 if autosuspend was not disabled.
43 */
44int autosuspend_disable(void);
45
46__END_DECLS
47
48#endif