ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-arm / apm.h
1 /* -*- linux-c -*-
2  *
3  * (C) 2003 zecke@handhelds.org
4  *
5  * GPL version 2
6  *
7  * based on arch/arm/kernel/apm.c
8  * factor out the information needed by architectures to provide
9  * apm status
10  *
11  *
12  */
13 #ifndef ARM_ASM_SA1100_APM_H
14 #define ARM_ASM_SA1100_APM_H
15
16 #include <linux/config.h>
17
18 #ifdef CONFIG_APM
19
20
21 #define APM_AC_OFFLINE 0
22 #define APM_AC_ONLINE 1
23 #define APM_AC_BACKUP 2
24 #define APM_AC_UNKNOWN 0xFF
25
26 #define APM_BATTERY_STATUS_HIGH 0
27 #define APM_BATTERY_STATUS_LOW  1
28 #define APM_BATTERY_STATUS_CRITICAL 2
29 #define APM_BATTERY_STATUS_CHARGING 3
30 #define APM_BATTERY_STATUS_UNKNOWN 0xFF
31
32 #define APM_BATTERY_LIFE_UNKNOWN 0xFFFF
33 #define APM_BATTERY_LIFE_MINUTES 0x8000
34 #define APM_BATTERY_LIFE_VALUE_MASK 0x7FFF
35
36 /*
37  * This structure gets filled in by the machine specific 'get_power_status'
38  * implementation.  Any fields which are not set default to a safe value.
39  */
40 struct apm_power_info {
41         unsigned char   ac_line_status;
42         unsigned char   battery_status;
43         unsigned char   battery_flag;
44         unsigned char   battery_life;
45         int             time;
46         int             units;
47 };
48
49 /*
50  * This allows machines to provide their own "apm get power status" function.
51  */
52 extern void (*apm_get_power_status)(struct apm_power_info *);
53 #endif
54
55
56 #endif