/
mce-dsme.h
73 lines (63 loc) · 2.19 KB
/
mce-dsme.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/**
* @file mce-dsme.h
* Headers for the DSME<->MCE interface and logic
* <p>
* Copyright © 2004-2011 Nokia Corporation and/or its subsidiary(-ies).
* <p>
* @author David Weinehall <david.weinehall@nokia.com>
*
* mce is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* mce is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with mce. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _MCE_DSME_H_
#define _MCE_DSME_H_
#include <glib.h>
/** How long to delay removal of MCE_TRANSITION_SUBMODE after
* receiving system state change from dsme
*
* <0 -> immediately
* 0 -> from idle callback
* >0 -> from timer callback after TRANSITION_DELAY ms
*/
#define TRANSITION_DELAY -1
/** Name of Powerkey configuration group */
#define MCE_CONF_SOFTPOWEROFF_GROUP "SoftPowerOff"
/** Name of configuration key for charger connect policy in soft poweroff */
#define MCE_CONF_SOFTPOWEROFF_CHARGER_POLICY_CONNECT "ChargerPolicyConnect"
/**
* Name of configuration value for the "wake on charger" policy
* when in soft poweroff
*/
#define SOFTOFF_CHARGER_CONNECT_WAKEUP_STR "wakeup"
/**
* Name of configuration value for the "ignore charger" policy
* when in soft poweroff
*/
#define SOFTOFF_CHARGER_CONNECT_IGNORE_STR "ignore"
/** Soft poweroff charger connect policy */
enum {
/** Stay in offline mode */
SOFTOFF_CHARGER_CONNECT_WAKEUP = 0,
/** Restore previous mode */
SOFTOFF_CHARGER_CONNECT_IGNORE = 1,
/** Default setting */
DEFAULT_SOFTOFF_CHARGER_CONNECT = SOFTOFF_CHARGER_CONNECT_IGNORE,
};
void request_powerup(void);
void request_reboot(void);
void request_soft_poweron(void);
void request_soft_poweroff(void);
void request_normal_shutdown(void);
/* When MCE is made modular, this will be handled differently */
gboolean mce_dsme_init(void);
void mce_dsme_exit(void);
#endif /* _MCE_DSME_H_ */