xref: /haiku/headers/private/device/power_managment.h (revision e7c8829c5d8e5d34a2a1e111f1c06aceff256013)
1 #ifndef POWER_MANAGMENT_H
2 #define POWER_MANAGMENT_H
3 
4 #include <Drivers.h>
5 
6 // io controls
7 enum {
8 	// ioctl response with kMagicFreqID
9 	IDENTIFY_DEVICE = B_DEVICE_OP_CODES_END + 20001,
10 
11 	// CPU Frequence:
12 	// get a list of freq_info, the list is terminated with a element with
13 	// frequency = 0
14 	GET_CPU_FREQ_STATES = B_DEVICE_OP_CODES_END + 20005,
15 	// get and set a freq_info
16 	GET_CURENT_CPU_FREQ_STATE,
17 	SET_CPU_FREQ_STATE,
18 	// start watching for frequency changes, ioctl blocks until the frequency
19 	// has changed
20 	WATCH_CPU_FREQ,
21 	// stop all watching ioctl, ioctl return B_ERROR
22 	STOP_WATCHING_CPU_FREQ
23 };
24 
25 // CPU Frequence:
26 // magic id returned by IDENTIFY_DEVICE
27 const uint32 kMagicFreqID = 48921;
28 
29 #define MAX_CPU_FREQUENCY_STATES 10
30 
31 typedef struct {
32 	uint16			frequency;	// [Mhz]
33 	uint16			volts;
34 	uint16			id;
35 	int				power;
36 } freq_info;
37 
38 
39 #endif
40