1
2 #ifndef _POWERPC_PMI_H
3 #define _POWERPC_PMI_H
4
5
6
7
8
9
10
11
12
13
14
15
16
17 #ifdef __KERNEL__
18
19 #define PMI_TYPE_FREQ_CHANGE 0x01
20 #define PMI_TYPE_POWER_BUTTON 0x02
21 #define PMI_READ_TYPE 0
22 #define PMI_READ_DATA0 1
23 #define PMI_READ_DATA1 2
24 #define PMI_READ_DATA2 3
25 #define PMI_WRITE_TYPE 4
26 #define PMI_WRITE_DATA0 5
27 #define PMI_WRITE_DATA1 6
28 #define PMI_WRITE_DATA2 7
29
30 #define PMI_ACK 0x80
31
32 #define PMI_TIMEOUT 100
33
34 typedef struct {
35 u8 type;
36 u8 data0;
37 u8 data1;
38 u8 data2;
39 } pmi_message_t;
40
41 struct pmi_handler {
42 struct list_head node;
43 u8 type;
44 void (*handle_pmi_message) (pmi_message_t);
45 };
46
47 int pmi_register_handler(struct pmi_handler *);
48 void pmi_unregister_handler(struct pmi_handler *);
49
50 int pmi_send_message(pmi_message_t);
51
52 #endif
53 #endif