xref: /linux/include/acpi/acpixf.h (revision 20d0021394c1b070bf04b22c5bc8fdb437edd4c5)
1 
2 /******************************************************************************
3  *
4  * Name: acpixf.h - External interfaces to the ACPI subsystem
5  *
6  *****************************************************************************/
7 
8 /*
9  * Copyright (C) 2000 - 2005, R. Byron Moore
10  * All rights reserved.
11  *
12  * Redistribution and use in source and binary forms, with or without
13  * modification, are permitted provided that the following conditions
14  * are met:
15  * 1. Redistributions of source code must retain the above copyright
16  *    notice, this list of conditions, and the following disclaimer,
17  *    without modification.
18  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19  *    substantially similar to the "NO WARRANTY" disclaimer below
20  *    ("Disclaimer") and any redistribution must be conditioned upon
21  *    including a substantially similar Disclaimer requirement for further
22  *    binary redistribution.
23  * 3. Neither the names of the above-listed copyright holders nor the names
24  *    of any contributors may be used to endorse or promote products derived
25  *    from this software without specific prior written permission.
26  *
27  * Alternatively, this software may be distributed under the terms of the
28  * GNU General Public License ("GPL") version 2 as published by the Free
29  * Software Foundation.
30  *
31  * NO WARRANTY
32  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
35  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
40  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
41  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42  * POSSIBILITY OF SUCH DAMAGES.
43  */
44 
45 
46 #ifndef __ACXFACE_H__
47 #define __ACXFACE_H__
48 
49 #include "actypes.h"
50 #include "actbl.h"
51 
52 
53 /*
54  * Global interfaces
55  */
56 acpi_status
57 acpi_initialize_subsystem (
58 	void);
59 
60 acpi_status
61 acpi_enable_subsystem (
62 	u32                             flags);
63 
64 acpi_status
65 acpi_initialize_objects (
66 	u32                             flags);
67 
68 acpi_status
69 acpi_terminate (
70 	void);
71 
72 #ifdef ACPI_FUTURE_USAGE
73 acpi_status
74 acpi_subsystem_status (
75 	void);
76 #endif
77 
78 acpi_status
79 acpi_enable (
80 	void);
81 
82 acpi_status
83 acpi_disable (
84 	void);
85 
86 #ifdef ACPI_FUTURE_USAGE
87 acpi_status
88 acpi_get_system_info (
89 	struct acpi_buffer              *ret_buffer);
90 #endif
91 
92 const char *
93 acpi_format_exception (
94 	acpi_status                     exception);
95 
96 acpi_status
97 acpi_purge_cached_objects (
98 	void);
99 
100 #ifdef ACPI_FUTURE_USAGE
101 acpi_status
102 acpi_install_initialization_handler (
103 	acpi_init_handler               handler,
104 	u32                             function);
105 #endif
106 
107 /*
108  * ACPI Memory managment
109  */
110 void *
111 acpi_allocate (
112 	u32                             size);
113 
114 void *
115 acpi_callocate (
116 	u32                             size);
117 
118 void
119 acpi_free (
120 	void                            *address);
121 
122 
123 /*
124  * ACPI table manipulation interfaces
125  */
126 acpi_status
127 acpi_find_root_pointer (
128 	u32                             flags,
129 	struct acpi_pointer             *rsdp_address);
130 
131 acpi_status
132 acpi_load_tables (
133 	void);
134 
135 #ifdef ACPI_FUTURE_USAGE
136 acpi_status
137 acpi_load_table (
138 	struct acpi_table_header        *table_ptr);
139 
140 acpi_status
141 acpi_unload_table (
142 	acpi_table_type                 table_type);
143 
144 acpi_status
145 acpi_get_table_header (
146 	acpi_table_type                 table_type,
147 	u32                             instance,
148 	struct acpi_table_header        *out_table_header);
149 #endif  /*  ACPI_FUTURE_USAGE  */
150 
151 acpi_status
152 acpi_get_table (
153 	acpi_table_type                 table_type,
154 	u32                             instance,
155 	struct acpi_buffer              *ret_buffer);
156 
157 acpi_status
158 acpi_get_firmware_table (
159 	acpi_string                     signature,
160 	u32                             instance,
161 	u32                             flags,
162 	struct acpi_table_header        **table_pointer);
163 
164 
165 /*
166  * Namespace and name interfaces
167  */
168 acpi_status
169 acpi_walk_namespace (
170 	acpi_object_type                type,
171 	acpi_handle                     start_object,
172 	u32                             max_depth,
173 	acpi_walk_callback              user_function,
174 	void                            *context,
175 	void                            **return_value);
176 
177 acpi_status
178 acpi_get_devices (
179 	char                            *HID,
180 	acpi_walk_callback              user_function,
181 	void                            *context,
182 	void                            **return_value);
183 
184 acpi_status
185 acpi_get_name (
186 	acpi_handle                     handle,
187 	u32                             name_type,
188 	struct acpi_buffer              *ret_path_ptr);
189 
190 acpi_status
191 acpi_get_handle (
192 	acpi_handle                     parent,
193 	acpi_string                     pathname,
194 	acpi_handle                     *ret_handle);
195 
196 acpi_status
197 acpi_attach_data (
198 	acpi_handle                     obj_handle,
199 	acpi_object_handler             handler,
200 	void                            *data);
201 
202 acpi_status
203 acpi_detach_data (
204 	acpi_handle                     obj_handle,
205 	acpi_object_handler             handler);
206 
207 acpi_status
208 acpi_get_data (
209 	acpi_handle                     obj_handle,
210 	acpi_object_handler             handler,
211 	void                            **data);
212 
213 
214 /*
215  * Object manipulation and enumeration
216  */
217 acpi_status
218 acpi_evaluate_object (
219 	acpi_handle                     object,
220 	acpi_string                     pathname,
221 	struct acpi_object_list         *parameter_objects,
222 	struct acpi_buffer              *return_object_buffer);
223 
224 #ifdef ACPI_FUTURE_USAGE
225 acpi_status
226 acpi_evaluate_object_typed (
227 	acpi_handle                     object,
228 	acpi_string                     pathname,
229 	struct acpi_object_list         *external_params,
230 	struct acpi_buffer              *return_buffer,
231 	acpi_object_type                return_type);
232 #endif
233 
234 acpi_status
235 acpi_get_object_info (
236 	acpi_handle                     handle,
237 	struct acpi_buffer              *return_buffer);
238 
239 acpi_status
240 acpi_get_next_object (
241 	acpi_object_type                type,
242 	acpi_handle                     parent,
243 	acpi_handle                     child,
244 	acpi_handle                     *out_handle);
245 
246 acpi_status
247 acpi_get_type (
248 	acpi_handle                     object,
249 	acpi_object_type                *out_type);
250 
251 acpi_status
252 acpi_get_parent (
253 	acpi_handle                     object,
254 	acpi_handle                     *out_handle);
255 
256 
257 /*
258  * Event handler interfaces
259  */
260 acpi_status
261 acpi_install_fixed_event_handler (
262 	u32                             acpi_event,
263 	acpi_event_handler              handler,
264 	void                            *context);
265 
266 acpi_status
267 acpi_remove_fixed_event_handler (
268 	u32                             acpi_event,
269 	acpi_event_handler              handler);
270 
271 acpi_status
272 acpi_install_notify_handler (
273 	acpi_handle                     device,
274 	u32                             handler_type,
275 	acpi_notify_handler             handler,
276 	void                            *context);
277 
278 acpi_status
279 acpi_remove_notify_handler (
280 	acpi_handle                     device,
281 	u32                             handler_type,
282 	acpi_notify_handler             handler);
283 
284 acpi_status
285 acpi_install_address_space_handler (
286 	acpi_handle                     device,
287 	acpi_adr_space_type             space_id,
288 	acpi_adr_space_handler          handler,
289 	acpi_adr_space_setup            setup,
290 	void                            *context);
291 
292 acpi_status
293 acpi_remove_address_space_handler (
294 	acpi_handle                     device,
295 	acpi_adr_space_type             space_id,
296 	acpi_adr_space_handler          handler);
297 
298 acpi_status
299 acpi_install_gpe_handler (
300 	acpi_handle                     gpe_device,
301 	u32                             gpe_number,
302 	u32                             type,
303 	acpi_event_handler              address,
304 	void                            *context);
305 
306 #ifdef ACPI_FUTURE_USAGE
307 acpi_status
308 acpi_install_exception_handler (
309 	acpi_exception_handler          handler);
310 #endif
311 
312 
313 /*
314  * Event interfaces
315  */
316 acpi_status
317 acpi_acquire_global_lock (
318 	u16                             timeout,
319 	u32                             *handle);
320 
321 acpi_status
322 acpi_release_global_lock (
323 	u32                             handle);
324 
325 acpi_status
326 acpi_remove_gpe_handler (
327 	acpi_handle                     gpe_device,
328 	u32                             gpe_number,
329 	acpi_event_handler              address);
330 
331 acpi_status
332 acpi_enable_event (
333 	u32                             event,
334 	u32                             flags);
335 
336 acpi_status
337 acpi_disable_event (
338 	u32                             event,
339 	u32                             flags);
340 
341 acpi_status
342 acpi_clear_event (
343 	u32                             event);
344 
345 #ifdef ACPI_FUTURE_USAGE
346 acpi_status
347 acpi_get_event_status (
348 	u32                             event,
349 	acpi_event_status               *event_status);
350 #endif  /*  ACPI_FUTURE_USAGE  */
351 
352 acpi_status
353 acpi_set_gpe_type (
354 	acpi_handle                     gpe_device,
355 	u32                             gpe_number,
356 	u8                              type);
357 
358 acpi_status
359 acpi_enable_gpe (
360 	acpi_handle                     gpe_device,
361 	u32                             gpe_number,
362 	u32                             flags);
363 
364 acpi_status
365 acpi_disable_gpe (
366 	acpi_handle                     gpe_device,
367 	u32                             gpe_number,
368 	u32                             flags);
369 
370 acpi_status
371 acpi_clear_gpe (
372 	acpi_handle                     gpe_device,
373 	u32                             gpe_number,
374 	u32                             flags);
375 
376 #ifdef ACPI_FUTURE_USAGE
377 acpi_status
378 acpi_get_gpe_status (
379 	acpi_handle                     gpe_device,
380 	u32                             gpe_number,
381 	u32                             flags,
382 	acpi_event_status               *event_status);
383 #endif  /*  ACPI_FUTURE_USAGE  */
384 
385 acpi_status
386 acpi_install_gpe_block (
387 	acpi_handle                     gpe_device,
388 	struct acpi_generic_address     *gpe_block_address,
389 	u32                             register_count,
390 	u32                             interrupt_level);
391 
392 acpi_status
393 acpi_remove_gpe_block (
394 	acpi_handle                     gpe_device);
395 
396 
397 /*
398  * Resource interfaces
399  */
400 typedef
401 acpi_status (*ACPI_WALK_RESOURCE_CALLBACK) (
402 	struct acpi_resource            *resource,
403 	void                            *context);
404 
405 
406 acpi_status
407 acpi_get_current_resources(
408 	acpi_handle                     device_handle,
409 	struct acpi_buffer              *ret_buffer);
410 
411 #ifdef ACPI_FUTURE_USAGE
412 acpi_status
413 acpi_get_possible_resources(
414 	acpi_handle                     device_handle,
415 	struct acpi_buffer              *ret_buffer);
416 #endif
417 
418 acpi_status
419 acpi_walk_resources (
420 	acpi_handle                             device_handle,
421 	char                                    *path,
422 	ACPI_WALK_RESOURCE_CALLBACK     user_function,
423 	void                                    *context);
424 
425 acpi_status
426 acpi_set_current_resources (
427 	acpi_handle                     device_handle,
428 	struct acpi_buffer              *in_buffer);
429 
430 acpi_status
431 acpi_get_irq_routing_table (
432 	acpi_handle                     bus_device_handle,
433 	struct acpi_buffer              *ret_buffer);
434 
435 acpi_status
436 acpi_resource_to_address64 (
437 	struct acpi_resource            *resource,
438 	struct acpi_resource_address64 *out);
439 
440 /*
441  * Hardware (ACPI device) interfaces
442  */
443 acpi_status
444 acpi_get_register (
445 	u32                             register_id,
446 	u32                             *return_value,
447 	u32                             flags);
448 
449 acpi_status
450 acpi_set_register (
451 	u32                             register_id,
452 	u32                             value,
453 	u32                             flags);
454 
455 acpi_status
456 acpi_set_firmware_waking_vector (
457 	acpi_physical_address           physical_address);
458 
459 #ifdef ACPI_FUTURE_USAGE
460 acpi_status
461 acpi_get_firmware_waking_vector (
462 	acpi_physical_address           *physical_address);
463 #endif
464 
465 acpi_status
466 acpi_get_sleep_type_data (
467 	u8                              sleep_state,
468 	u8                              *slp_typ_a,
469 	u8                              *slp_typ_b);
470 
471 acpi_status
472 acpi_enter_sleep_state_prep (
473 	u8                              sleep_state);
474 
475 acpi_status asmlinkage
476 acpi_enter_sleep_state (
477 	u8                              sleep_state);
478 
479 acpi_status asmlinkage
480 acpi_enter_sleep_state_s4bios (
481 	void);
482 
483 acpi_status
484 acpi_leave_sleep_state (
485 	u8                              sleep_state);
486 
487 
488 #endif /* __ACXFACE_H__ */
489