40890e97b3
This is a very welcome addition. * There are a few issues, and maybe questionable decisions (like the dependence on ACPI), but I see no reason why it shouldn't be added in its current form already. * Unfortunately, I could not test it yet, though, as the CPU of my laptop is not supported; will see if I can find a supported hardware, though. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28903 a95241bf-73f2-0310-859d-f6bbb57e9c96
40 lines
860 B
C
40 lines
860 B
C
#ifndef POWER_MANAGMENT_H
|
|
#define POWER_MANAGMENT_H
|
|
|
|
#include <Drivers.h>
|
|
|
|
// io controls
|
|
enum {
|
|
// ioctl response with kMagicFreqID
|
|
IDENTIFY_DEVICE = B_DEVICE_OP_CODES_END + 20001,
|
|
|
|
// CPU Frequence:
|
|
// get a list of freq_info, the list is terminated with a element with
|
|
// frequency = 0
|
|
GET_CPU_FREQ_STATES = B_DEVICE_OP_CODES_END + 20005,
|
|
// get and set a freq_info
|
|
GET_CURENT_CPU_FREQ_STATE,
|
|
SET_CPU_FREQ_STATE,
|
|
// start watching for frequency changes, ioctl blocks until the frequency
|
|
// has changed
|
|
WATCH_CPU_FREQ,
|
|
// stop all watching ioctl, ioctl return B_ERROR
|
|
STOP_WATCHING_CPU_FREQ
|
|
};
|
|
|
|
// CPU Frequence:
|
|
// magic id returned by IDENTIFY_DEVICE
|
|
const uint32 kMagicFreqID = 48921;
|
|
|
|
#define MAX_CPU_FREQUENCY_STATES 10
|
|
|
|
typedef struct {
|
|
uint16 frequency; // [Mhz]
|
|
uint16 volts;
|
|
uint16 id;
|
|
int power;
|
|
} freq_info;
|
|
|
|
|
|
#endif
|