blob: 10e3d27d25ecfc61249b4c11fb413fac54e25915 [file] [log] [blame]
Colin Crossa2582c22012-05-03 17:30:16 -07001/*
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
Dianne Hackborn9552cdf2014-03-07 11:00:39 -080046/*
47 * set_wakeup_callback
48 *
49 * Set a function to be called each time the device wakes up from suspend.
50 */
51void set_wakeup_callback(void (*func)(void));
52
Colin Crossa2582c22012-05-03 17:30:16 -070053__END_DECLS
54
55#endif