[ACPI] Merge acpi-2.6.12 branch into 2.6.13-rc3
[pandora-kernel.git] / include / acpi / acevents.h
1 /******************************************************************************
2  *
3  * Name: acevents.h - Event subcomponent prototypes and defines
4  *
5  *****************************************************************************/
6
7 /*
8  * Copyright (C) 2000 - 2005, R. Byron Moore
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions
13  * are met:
14  * 1. Redistributions of source code must retain the above copyright
15  *    notice, this list of conditions, and the following disclaimer,
16  *    without modification.
17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18  *    substantially similar to the "NO WARRANTY" disclaimer below
19  *    ("Disclaimer") and any redistribution must be conditioned upon
20  *    including a substantially similar Disclaimer requirement for further
21  *    binary redistribution.
22  * 3. Neither the names of the above-listed copyright holders nor the names
23  *    of any contributors may be used to endorse or promote products derived
24  *    from this software without specific prior written permission.
25  *
26  * Alternatively, this software may be distributed under the terms of the
27  * GNU General Public License ("GPL") version 2 as published by the Free
28  * Software Foundation.
29  *
30  * NO WARRANTY
31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41  * POSSIBILITY OF SUCH DAMAGES.
42  */
43
44 #ifndef __ACEVENTS_H__
45 #define __ACEVENTS_H__
46
47
48 /*
49  * evevent
50  */
51 acpi_status
52 acpi_ev_initialize_events (
53         void);
54
55 acpi_status
56 acpi_ev_install_xrupt_handlers (
57         void);
58
59 u32
60 acpi_ev_fixed_event_detect (
61         void);
62
63
64 /*
65  * evmisc
66  */
67 u8
68 acpi_ev_is_notify_object (
69         struct acpi_namespace_node      *node);
70
71 acpi_status
72 acpi_ev_acquire_global_lock(
73         u16                             timeout);
74
75 acpi_status
76 acpi_ev_release_global_lock(
77         void);
78
79 acpi_status
80 acpi_ev_init_global_lock_handler (
81         void);
82
83 u32
84 acpi_ev_get_gpe_number_index (
85         u32                             gpe_number);
86
87 acpi_status
88 acpi_ev_queue_notify_request (
89         struct acpi_namespace_node      *node,
90         u32                             notify_value);
91
92
93 /*
94  * evgpe - GPE handling and dispatch
95  */
96 acpi_status
97 acpi_ev_update_gpe_enable_masks (
98         struct acpi_gpe_event_info      *gpe_event_info,
99         u8                              type);
100
101 acpi_status
102 acpi_ev_enable_gpe (
103         struct acpi_gpe_event_info      *gpe_event_info,
104         u8                              write_to_hardware);
105
106 acpi_status
107 acpi_ev_disable_gpe (
108         struct acpi_gpe_event_info      *gpe_event_info);
109
110 struct acpi_gpe_event_info *
111 acpi_ev_get_gpe_event_info (
112         acpi_handle                     gpe_device,
113         u32                             gpe_number);
114
115
116 /*
117  * evgpeblk
118  */
119 u8
120 acpi_ev_valid_gpe_event (
121         struct acpi_gpe_event_info      *gpe_event_info);
122
123 acpi_status
124 acpi_ev_walk_gpe_list (
125         ACPI_GPE_CALLBACK       gpe_walk_callback);
126
127 acpi_status
128 acpi_ev_delete_gpe_handlers (
129         struct acpi_gpe_xrupt_info      *gpe_xrupt_info,
130         struct acpi_gpe_block_info      *gpe_block);
131
132 acpi_status
133 acpi_ev_create_gpe_block (
134         struct acpi_namespace_node      *gpe_device,
135         struct acpi_generic_address     *gpe_block_address,
136         u32                             register_count,
137         u8                              gpe_block_base_number,
138         u32                             interrupt_number,
139         struct acpi_gpe_block_info      **return_gpe_block);
140
141 acpi_status
142 acpi_ev_delete_gpe_block (
143         struct acpi_gpe_block_info      *gpe_block);
144
145 u32
146 acpi_ev_gpe_dispatch (
147         struct acpi_gpe_event_info      *gpe_event_info,
148         u32                             gpe_number);
149
150 u32
151 acpi_ev_gpe_detect (
152         struct acpi_gpe_xrupt_info      *gpe_xrupt_list);
153
154 acpi_status
155 acpi_ev_set_gpe_type (
156         struct acpi_gpe_event_info      *gpe_event_info,
157         u8                              type);
158
159 acpi_status
160 acpi_ev_check_for_wake_only_gpe (
161         struct acpi_gpe_event_info      *gpe_event_info);
162
163 acpi_status
164 acpi_ev_gpe_initialize (
165         void);
166
167
168 /*
169  * evregion - Address Space handling
170  */
171 acpi_status
172 acpi_ev_install_region_handlers (
173         void);
174
175 acpi_status
176 acpi_ev_initialize_op_regions (
177         void);
178
179 acpi_status
180 acpi_ev_address_space_dispatch (
181         union acpi_operand_object      *region_obj,
182         u32                             function,
183         acpi_physical_address           address,
184         u32                             bit_width,
185         void                            *value);
186
187 acpi_status
188 acpi_ev_attach_region (
189         union acpi_operand_object       *handler_obj,
190         union acpi_operand_object       *region_obj,
191         u8                              acpi_ns_is_locked);
192
193 void
194 acpi_ev_detach_region (
195         union acpi_operand_object      *region_obj,
196         u8                              acpi_ns_is_locked);
197
198 acpi_status
199 acpi_ev_install_space_handler (
200         struct acpi_namespace_node      *node,
201         acpi_adr_space_type             space_id,
202         acpi_adr_space_handler          handler,
203         acpi_adr_space_setup            setup,
204         void                            *context);
205
206 acpi_status
207 acpi_ev_execute_reg_methods (
208         struct acpi_namespace_node      *node,
209         acpi_adr_space_type             space_id);
210
211 acpi_status
212 acpi_ev_execute_reg_method (
213         union acpi_operand_object      *region_obj,
214         u32                             function);
215
216
217 /*
218  * evregini - Region initialization and setup
219  */
220 acpi_status
221 acpi_ev_system_memory_region_setup (
222         acpi_handle                     handle,
223         u32                             function,
224         void                            *handler_context,
225         void                            **region_context);
226
227 acpi_status
228 acpi_ev_io_space_region_setup (
229         acpi_handle                     handle,
230         u32                             function,
231         void                            *handler_context,
232         void                            **region_context);
233
234 acpi_status
235 acpi_ev_pci_config_region_setup (
236         acpi_handle                     handle,
237         u32                             function,
238         void                            *handler_context,
239         void                            **region_context);
240
241 acpi_status
242 acpi_ev_cmos_region_setup (
243         acpi_handle                     handle,
244         u32                             function,
245         void                            *handler_context,
246         void                            **region_context);
247
248 acpi_status
249 acpi_ev_pci_bar_region_setup (
250         acpi_handle                     handle,
251         u32                             function,
252         void                            *handler_context,
253         void                            **region_context);
254
255 acpi_status
256 acpi_ev_default_region_setup (
257         acpi_handle                     handle,
258         u32                             function,
259         void                            *handler_context,
260         void                            **region_context);
261
262 acpi_status
263 acpi_ev_initialize_region (
264         union acpi_operand_object       *region_obj,
265         u8                              acpi_ns_locked);
266
267
268 /*
269  * evsci - SCI (System Control Interrupt) handling/dispatch
270  */
271 u32 ACPI_SYSTEM_XFACE
272 acpi_ev_gpe_xrupt_handler (
273         void                            *context);
274
275 u32
276 acpi_ev_install_sci_handler (
277         void);
278
279 acpi_status
280 acpi_ev_remove_sci_handler (
281         void);
282
283 u32
284 acpi_ev_initialize_sCI (
285         u32                             program_sCI);
286
287 void
288 acpi_ev_terminate (
289         void);
290
291
292 #endif  /* __ACEVENTS_H__  */