0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef __LINUX_APM_EMULATION_H
0011 #define __LINUX_APM_EMULATION_H
0012
0013 #include <linux/apm_bios.h>
0014
0015
0016
0017
0018
0019 struct apm_power_info {
0020 unsigned char ac_line_status;
0021 #define APM_AC_OFFLINE 0
0022 #define APM_AC_ONLINE 1
0023 #define APM_AC_BACKUP 2
0024 #define APM_AC_UNKNOWN 0xff
0025
0026 unsigned char battery_status;
0027 #define APM_BATTERY_STATUS_HIGH 0
0028 #define APM_BATTERY_STATUS_LOW 1
0029 #define APM_BATTERY_STATUS_CRITICAL 2
0030 #define APM_BATTERY_STATUS_CHARGING 3
0031 #define APM_BATTERY_STATUS_NOT_PRESENT 4
0032 #define APM_BATTERY_STATUS_UNKNOWN 0xff
0033
0034 unsigned char battery_flag;
0035 #define APM_BATTERY_FLAG_HIGH (1 << 0)
0036 #define APM_BATTERY_FLAG_LOW (1 << 1)
0037 #define APM_BATTERY_FLAG_CRITICAL (1 << 2)
0038 #define APM_BATTERY_FLAG_CHARGING (1 << 3)
0039 #define APM_BATTERY_FLAG_NOT_PRESENT (1 << 7)
0040 #define APM_BATTERY_FLAG_UNKNOWN 0xff
0041
0042 int battery_life;
0043 int time;
0044 int units;
0045 #define APM_UNITS_MINS 0
0046 #define APM_UNITS_SECS 1
0047 #define APM_UNITS_UNKNOWN -1
0048
0049 };
0050
0051
0052
0053
0054 extern void (*apm_get_power_status)(struct apm_power_info *);
0055
0056
0057
0058
0059 void apm_queue_event(apm_event_t event);
0060
0061 #endif