Battery interface for the driver.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31485 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Clemens Zeidler 2009-07-09 17:53:09 +00:00
parent 6aed176c09
commit a635614420

View File

@ -19,13 +19,20 @@ enum {
// has changed // has changed
WATCH_CPU_FREQ, WATCH_CPU_FREQ,
// stop all watching ioctl, ioctl return B_ERROR // stop all watching ioctl, ioctl return B_ERROR
STOP_WATCHING_CPU_FREQ STOP_WATCHING_CPU_FREQ,
GET_BATTERY_INFO,
GET_EXTENDED_BATTERY_INFO,
WATCH_BATTERY,
STOP_WATCHING_BATTERY
}; };
// CPU Frequence: // CPU Frequence:
// magic id returned by IDENTIFY_DEVICE // magic id returned by IDENTIFY_DEVICE
const uint32 kMagicFreqID = 48921; const uint32 kMagicFreqID = 48921;
#define MAX_CPU_FREQUENCY_STATES 10 #define MAX_CPU_FREQUENCY_STATES 10
typedef struct { typedef struct {
@ -36,4 +43,38 @@ typedef struct {
} freq_info; } freq_info;
// ACPI Battery:
// magic id returned by IDENTIFY_DEVICE
const uint32 kMagicACPIBatteryID = 17822;
#define BATTERY_DISCHARGING 0x01
#define BATTERY_CHARGING 0x02
#define BATTERY_CRITICAL_STATE 0x04
typedef struct {
int state;
int current_rate;
int capacity;
int voltage;
} acpi_battery_info;
typedef struct {
int power_unit;
int design_capacity;
int last_full_charge;
int technology;
int design_voltage;
int design_capacity_warning;
int design_capacity_low;
int capacity_granularity_1;
int capacity_granularity_2;
char model_number[32];
char serial_number[32];
char type[32];
char oem_info[32];
} acpi_extended_battery_info;
#endif #endif