blob: 943c6d7856ca3f2b50c8a9396459996c4c9a5e94 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/******************************************************************************
2 *
3 * Name: acpixf.h - External interfaces to the ACPI subsystem
4 *
5 *****************************************************************************/
6
7/*
Bob Moorefbb7a2d2014-02-08 09:42:25 +08008 * Copyright (C) 2000 - 2014, Intel Corp.
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 * 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
Linus Torvalds1da177e2005-04-16 15:20:36 -070044#ifndef __ACXFACE_H__
45#define __ACXFACE_H__
46
Bob Moore50df4d82008-12-31 03:01:23 +080047/* Current ACPICA subsystem version in YYYYMMDD format */
48
Bob Moored2716572014-02-26 10:33:55 +080049#define ACPI_CA_VERSION 0x20140214
Bob Moore50df4d82008-12-31 03:01:23 +080050
David Howellsa1ce3922012-10-02 18:01:25 +010051#include <acpi/acconfig.h>
52#include <acpi/actypes.h>
53#include <acpi/actbl.h>
Linus Torvaldsd8dc91b2012-10-08 07:14:06 +090054#include <acpi/acbuffer.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070055
Lin Ming889c78b2008-12-31 09:23:57 +080056extern u8 acpi_gbl_permanent_mmap;
57
Bob Moore4ac4c5f2014-02-26 10:28:32 +080058#pragma pack(push) /* Set default struct packing */
59
Robert Moore44f6c012005-04-18 22:49:35 -040060/*
Lv Zheng75c80442012-12-19 05:36:49 +000061 * Globals that are publically available
Bob Moore50df4d82008-12-31 03:01:23 +080062 */
Lv Zheng739dcbb2012-12-20 01:07:26 +000063extern u32 acpi_current_gpe_count;
64extern struct acpi_table_fadt acpi_gbl_FADT;
65extern u8 acpi_gbl_system_awake_and_running;
66extern u8 acpi_gbl_reduced_hardware; /* ACPI 5.0 */
Aaron Lu242b2282013-07-02 21:59:10 +080067extern u8 acpi_gbl_osi_data;
Lv Zheng3e8214e2012-12-19 05:37:15 +000068
Lv Zheng75c80442012-12-19 05:36:49 +000069/* Runtime configuration of debug print levels */
Lv Zheng3e8214e2012-12-19 05:37:15 +000070
Bob Moore50df4d82008-12-31 03:01:23 +080071extern u32 acpi_dbg_level;
72extern u32 acpi_dbg_layer;
Lv Zheng3e8214e2012-12-19 05:37:15 +000073
Lv Zheng75c80442012-12-19 05:36:49 +000074/* ACPICA runtime options */
Lv Zheng3e8214e2012-12-19 05:37:15 +000075
Bob Moore50df4d82008-12-31 03:01:23 +080076extern u8 acpi_gbl_all_methods_serialized;
Lin Ming69ec87e2010-04-01 11:14:12 +080077extern u8 acpi_gbl_copy_dsdt_locally;
Lv Zhengfab46102014-01-08 13:43:40 +080078extern u8 acpi_gbl_create_osi_method;
Bob Moored57b23a2011-07-04 08:24:03 +000079extern u8 acpi_gbl_disable_auto_repair;
Lv Zhengb75dd292013-06-08 00:58:48 +000080extern u8 acpi_gbl_disable_ssdt_table_load;
Lv Zhengfab46102014-01-08 13:43:40 +080081extern u8 acpi_gbl_do_not_use_xsdt;
Lv Zheng481c1382014-01-24 08:49:51 +080082extern u8 acpi_gbl_enable_aml_debug_object;
Lv Zhengfab46102014-01-08 13:43:40 +080083extern u8 acpi_gbl_enable_interpreter_slack;
84extern u32 acpi_gbl_trace_flags;
85extern acpi_name acpi_gbl_trace_method_name;
86extern u8 acpi_gbl_truncate_io_addresses;
Bob Moore0249ed22014-01-08 13:43:46 +080087extern u8 acpi_gbl_use32_bit_fadt_addresses;
Lv Zhengfab46102014-01-08 13:43:40 +080088extern u8 acpi_gbl_use_default_register_widths;
Bob Moore50df4d82008-12-31 03:01:23 +080089
Bob Moore33620c52012-02-14 18:14:27 +080090/*
91 * Hardware-reduced prototypes. All interfaces that use these macros will
92 * be configured out of the ACPICA build if the ACPI_REDUCED_HARDWARE flag
93 * is set to TRUE.
94 */
95#if (!ACPI_REDUCED_HARDWARE)
96#define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
97 prototype;
98
99#define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
100 prototype;
101
102#define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
103 prototype;
104
105#else
106#define ACPI_HW_DEPENDENT_RETURN_STATUS(prototype) \
107 static ACPI_INLINE prototype {return(AE_NOT_CONFIGURED);}
108
109#define ACPI_HW_DEPENDENT_RETURN_OK(prototype) \
110 static ACPI_INLINE prototype {return(AE_OK);}
111
112#define ACPI_HW_DEPENDENT_RETURN_VOID(prototype) \
Bob Moorec26f3c92013-10-29 09:29:16 +0800113 static ACPI_INLINE prototype {return;}
Bob Moore33620c52012-02-14 18:14:27 +0800114
115#endif /* !ACPI_REDUCED_HARDWARE */
116
Bob Moore50df4d82008-12-31 03:01:23 +0800117/*
Lv Zheng75c80442012-12-19 05:36:49 +0000118 * Initialization
Linus Torvalds1da177e2005-04-16 15:20:36 -0700119 */
Lv Zheng45c9f782013-10-31 09:31:24 +0800120acpi_status __init
Bob Mooref3d2e782007-02-02 19:48:18 +0300121acpi_initialize_tables(struct acpi_table_desc *initial_storage,
122 u32 initial_table_count, u8 allow_resize);
123
Len Browndd272b52007-05-30 00:26:11 -0400124acpi_status __init acpi_initialize_subsystem(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125
Lv Zheng45c9f782013-10-31 09:31:24 +0800126acpi_status __init acpi_enable_subsystem(u32 flags);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127
Lv Zheng45c9f782013-10-31 09:31:24 +0800128acpi_status __init acpi_initialize_objects(u32 flags);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129
Lv Zheng45c9f782013-10-31 09:31:24 +0800130acpi_status __init acpi_terminate(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700131
Lv Zheng75c80442012-12-19 05:36:49 +0000132/*
133 * Miscellaneous global interfaces
134 */
Bob Moore33620c52012-02-14 18:14:27 +0800135ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable(void))
136ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable(void))
Lv Zheng739dcbb2012-12-20 01:07:26 +0000137#ifdef ACPI_FUTURE_USAGE
Lv Zhenged606942014-01-08 13:44:56 +0800138acpi_status acpi_subsystem_status(void);
Lv Zheng739dcbb2012-12-20 01:07:26 +0000139#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700140
141#ifdef ACPI_FUTURE_USAGE
Len Brown4be44fc2005-08-05 00:44:28 -0400142acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700143#endif
144
Lv Zheng9187a412013-10-31 09:30:28 +0800145acpi_status acpi_get_statistics(struct acpi_statistics *stats);
146
Len Brown4be44fc2005-08-05 00:44:28 -0400147const char *acpi_format_exception(acpi_status exception);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148
Len Brown4be44fc2005-08-05 00:44:28 -0400149acpi_status acpi_purge_cached_objects(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700150
Lin Mingb0ed7a92010-08-06 09:35:51 +0800151acpi_status acpi_install_interface(acpi_string interface_name);
152
153acpi_status acpi_remove_interface(acpi_string interface_name);
154
Lv Zheng2cf9f5b2013-07-22 16:08:16 +0800155acpi_status acpi_update_interfaces(u8 action);
156
Lin Mingf654c0f2012-01-12 13:10:32 +0800157u32
158acpi_check_address_range(acpi_adr_space_type space_id,
159 acpi_physical_address address,
160 acpi_size length, u8 warn);
161
Bob Moorebe030a52012-08-17 13:07:54 +0800162acpi_status
163acpi_decode_pld_buffer(u8 *in_buffer,
164 acpi_size length, struct acpi_pld_info **return_buffer);
165
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166/*
Bob Mooref60d8182012-07-16 10:21:34 +0800167 * ACPI table load/unload interfaces
168 */
169acpi_status acpi_load_table(struct acpi_table_header *table);
170
171acpi_status acpi_unload_parent_table(acpi_handle object);
172
Lv Zheng45c9f782013-10-31 09:31:24 +0800173acpi_status __init acpi_load_tables(void);
Bob Mooref60d8182012-07-16 10:21:34 +0800174
175/*
Linus Torvalds1da177e2005-04-16 15:20:36 -0700176 * ACPI table manipulation interfaces
177 */
Lv Zheng45c9f782013-10-31 09:31:24 +0800178acpi_status __init acpi_reallocate_root_table(void);
Bob Mooref3d2e782007-02-02 19:48:18 +0300179
Lv Zheng45c9f782013-10-31 09:31:24 +0800180acpi_status __init acpi_find_root_pointer(acpi_size *rsdp_address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181
Bob Mooref3d2e782007-02-02 19:48:18 +0300182acpi_status acpi_unload_table_id(acpi_owner_id id);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700183
184acpi_status
Bob Mooref3d2e782007-02-02 19:48:18 +0300185acpi_get_table_header(acpi_string signature,
Lv Zheng1f86e8c2012-10-31 02:25:45 +0000186 u32 instance, struct acpi_table_header *out_table_header);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700187
188acpi_status
Yinghai Lu7d972772009-02-07 15:39:41 -0800189acpi_get_table_with_size(acpi_string signature,
190 u32 instance, struct acpi_table_header **out_table,
191 acpi_size *tbl_size);
Lv Zhengcd27d792013-10-29 09:30:22 +0800192
Yinghai Lu7d972772009-02-07 15:39:41 -0800193acpi_status
Bob Mooref3d2e782007-02-02 19:48:18 +0300194acpi_get_table(acpi_string signature,
Bob Moore67a119f2008-06-10 13:42:13 +0800195 u32 instance, struct acpi_table_header **out_table);
Bob Mooref3d2e782007-02-02 19:48:18 +0300196
197acpi_status
Lv Zheng1f86e8c2012-10-31 02:25:45 +0000198acpi_get_table_by_index(u32 table_index, struct acpi_table_header **out_table);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199
Lin Ming3e08e2d2008-04-10 19:06:38 +0400200acpi_status
Lv Zhengb43e1062013-01-12 15:29:38 +0000201acpi_install_table_handler(acpi_table_handler handler, void *context);
Lin Ming3e08e2d2008-04-10 19:06:38 +0400202
Lv Zhengb43e1062013-01-12 15:29:38 +0000203acpi_status acpi_remove_table_handler(acpi_table_handler handler);
Lin Ming3e08e2d2008-04-10 19:06:38 +0400204
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205/*
206 * Namespace and name interfaces
207 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400209acpi_walk_namespace(acpi_object_type type,
210 acpi_handle start_object,
211 u32 max_depth,
Bob Moore4ef17502013-08-08 15:30:05 +0800212 acpi_walk_callback descending_callback,
213 acpi_walk_callback ascending_callback,
Len Brown4be44fc2005-08-05 00:44:28 -0400214 void *context, void **return_value);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700215
216acpi_status
Al Viro70b30fb2007-08-21 16:18:20 +0100217acpi_get_devices(const char *HID,
Len Brown4be44fc2005-08-05 00:44:28 -0400218 acpi_walk_callback user_function,
219 void *context, void **return_value);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220
221acpi_status
Bob Mooreb47cf582010-04-27 11:54:40 +0800222acpi_get_name(acpi_handle object,
Len Brown4be44fc2005-08-05 00:44:28 -0400223 u32 name_type, struct acpi_buffer *ret_path_ptr);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700224
225acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400226acpi_get_handle(acpi_handle parent,
227 acpi_string pathname, acpi_handle * ret_handle);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700228
229acpi_status
Bob Mooreb47cf582010-04-27 11:54:40 +0800230acpi_attach_data(acpi_handle object, acpi_object_handler handler, void *data);
231
232acpi_status acpi_detach_data(acpi_handle object, acpi_object_handler handler);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700233
234acpi_status
Bob Mooreb47cf582010-04-27 11:54:40 +0800235acpi_get_data(acpi_handle object, acpi_object_handler handler, void **data);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700236
Bob Moore50eca3e2005-09-30 19:03:00 -0400237acpi_status
238acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags);
239
Linus Torvalds1da177e2005-04-16 15:20:36 -0700240/*
241 * Object manipulation and enumeration
242 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700243acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400244acpi_evaluate_object(acpi_handle object,
245 acpi_string pathname,
246 struct acpi_object_list *parameter_objects,
247 struct acpi_buffer *return_object_buffer);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700248
Linus Torvalds1da177e2005-04-16 15:20:36 -0700249acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400250acpi_evaluate_object_typed(acpi_handle object,
251 acpi_string pathname,
252 struct acpi_object_list *external_params,
253 struct acpi_buffer *return_buffer,
254 acpi_object_type return_type);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700255
256acpi_status
Bob Mooreb47cf582010-04-27 11:54:40 +0800257acpi_get_object_info(acpi_handle object,
Bob Moore15b8dd52009-06-29 13:39:29 +0800258 struct acpi_device_info **return_buffer);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700259
Lin Mingb2f7ddc2009-05-21 10:42:09 +0800260acpi_status acpi_install_method(u8 *buffer);
261
Linus Torvalds1da177e2005-04-16 15:20:36 -0700262acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400263acpi_get_next_object(acpi_object_type type,
264 acpi_handle parent,
265 acpi_handle child, acpi_handle * out_handle);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266
Len Brown4be44fc2005-08-05 00:44:28 -0400267acpi_status acpi_get_type(acpi_handle object, acpi_object_type * out_type);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700268
John Keller0f0fe1a2006-12-19 12:56:19 -0800269acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type);
270
Len Brown4be44fc2005-08-05 00:44:28 -0400271acpi_status acpi_get_parent(acpi_handle object, acpi_handle * out_handle);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700272
273/*
Bob Mooreecfbbc72008-12-31 02:55:32 +0800274 * Handler interfaces
Linus Torvalds1da177e2005-04-16 15:20:36 -0700275 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276acpi_status
Bob Mooreecfbbc72008-12-31 02:55:32 +0800277acpi_install_initialization_handler(acpi_init_handler handler, u32 function);
278
Bob Moore33620c52012-02-14 18:14:27 +0800279ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
Lv Zhenga2fd4b42013-09-23 09:52:05 +0800280 acpi_install_sci_handler(acpi_sci_handler
281 address,
282 void *context))
283ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
284 acpi_remove_sci_handler(acpi_sci_handler
285 address))
286ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
287 acpi_install_global_event_handler
288 (acpi_gbl_event_handler handler,
289 void *context))
Bob Moore33620c52012-02-14 18:14:27 +0800290ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
291 acpi_install_fixed_event_handler(u32
292 acpi_event,
293 acpi_event_handler
294 handler,
295 void
296 *context))
297ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
298 acpi_remove_fixed_event_handler(u32 acpi_event,
299 acpi_event_handler
300 handler))
301ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
302 acpi_install_gpe_handler(acpi_handle
303 gpe_device,
304 u32 gpe_number,
305 u32 type,
306 acpi_gpe_handler
307 address,
308 void *context))
309ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
310 acpi_remove_gpe_handler(acpi_handle gpe_device,
311 u32 gpe_number,
312 acpi_gpe_handler
313 address))
Lv Zheng1f86e8c2012-10-31 02:25:45 +0000314acpi_status acpi_install_notify_handler(acpi_handle device, u32 handler_type,
Lv Zhenged606942014-01-08 13:44:56 +0800315 acpi_notify_handler handler,
316 void *context);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700317
318acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400319acpi_remove_notify_handler(acpi_handle device,
320 u32 handler_type, acpi_notify_handler handler);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700321
322acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400323acpi_install_address_space_handler(acpi_handle device,
324 acpi_adr_space_type space_id,
325 acpi_adr_space_handler handler,
326 acpi_adr_space_setup setup, void *context);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700327
328acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400329acpi_remove_address_space_handler(acpi_handle device,
330 acpi_adr_space_type space_id,
331 acpi_adr_space_handler handler);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700332
Linus Torvalds1da177e2005-04-16 15:20:36 -0700333#ifdef ACPI_FUTURE_USAGE
Len Brown4be44fc2005-08-05 00:44:28 -0400334acpi_status acpi_install_exception_handler(acpi_exception_handler handler);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700335#endif
336
Lin Mingb0ed7a92010-08-06 09:35:51 +0800337acpi_status acpi_install_interface_handler(acpi_interface_handler handler);
338
Linus Torvalds1da177e2005-04-16 15:20:36 -0700339/*
Lin Mingffef6822011-11-16 11:08:30 +0800340 * Global Lock interfaces
Linus Torvalds1da177e2005-04-16 15:20:36 -0700341 */
Bob Moore33620c52012-02-14 18:14:27 +0800342ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
343 acpi_acquire_global_lock(u16 timeout,
344 u32 *handle))
Lv Zhengcd27d792013-10-29 09:30:22 +0800345
Bob Moore33620c52012-02-14 18:14:27 +0800346ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
347 acpi_release_global_lock(u32 handle))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700348
Lin Mingffef6822011-11-16 11:08:30 +0800349/*
350 * Interfaces to AML mutex objects
351 */
352acpi_status
353acpi_acquire_mutex(acpi_handle handle, acpi_string pathname, u16 timeout);
354
355acpi_status acpi_release_mutex(acpi_handle handle, acpi_string pathname);
356
357/*
358 * Fixed Event interfaces
359 */
Bob Moore33620c52012-02-14 18:14:27 +0800360ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
361 acpi_enable_event(u32 event, u32 flags))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700362
Bob Moore33620c52012-02-14 18:14:27 +0800363ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
364 acpi_disable_event(u32 event, u32 flags))
Bob Moore33620c52012-02-14 18:14:27 +0800365ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_clear_event(u32 event))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700366
Bob Moore33620c52012-02-14 18:14:27 +0800367ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
368 acpi_get_event_status(u32 event,
369 acpi_event_status
370 *event_status))
Lv Zhengcd27d792013-10-29 09:30:22 +0800371
Bob Moore08ac07b2008-12-30 09:55:48 +0800372/*
Lin Mingffef6822011-11-16 11:08:30 +0800373 * General Purpose Event (GPE) Interfaces
Bob Moore08ac07b2008-12-30 09:55:48 +0800374 */
Bob Moore33620c52012-02-14 18:14:27 +0800375ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_update_all_gpes(void))
Len Brown4be44fc2005-08-05 00:44:28 -0400376
Bob Moore33620c52012-02-14 18:14:27 +0800377ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
378 acpi_enable_gpe(acpi_handle gpe_device,
379 u32 gpe_number))
Len Brown4be44fc2005-08-05 00:44:28 -0400380
Bob Moore33620c52012-02-14 18:14:27 +0800381ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
382 acpi_disable_gpe(acpi_handle gpe_device,
383 u32 gpe_number))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700384
Bob Moore33620c52012-02-14 18:14:27 +0800385ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
386 acpi_clear_gpe(acpi_handle gpe_device,
387 u32 gpe_number))
Lin Mingbba63a22010-12-13 13:39:17 +0800388
Bob Moore33620c52012-02-14 18:14:27 +0800389ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
390 acpi_set_gpe(acpi_handle gpe_device,
391 u32 gpe_number, u8 action))
Rafael J. Wysockie8b6f972010-06-25 01:18:39 +0200392
Bob Moore33620c52012-02-14 18:14:27 +0800393ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
394 acpi_finish_gpe(acpi_handle gpe_device,
395 u32 gpe_number))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700396
Bob Moore33620c52012-02-14 18:14:27 +0800397ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
398 acpi_setup_gpe_for_wake(acpi_handle
399 parent_device,
400 acpi_handle gpe_device,
401 u32 gpe_number))
402ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
403 acpi_set_gpe_wake_mask(acpi_handle gpe_device,
404 u32 gpe_number,
405 u8 action))
406ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
407 acpi_get_gpe_status(acpi_handle gpe_device,
408 u32 gpe_number,
409 acpi_event_status
410 *event_status))
Bob Moore33620c52012-02-14 18:14:27 +0800411ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_disable_all_gpes(void))
Bob Moore33620c52012-02-14 18:14:27 +0800412ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enable_all_runtime_gpes(void))
Bob Mooree97d6bf2008-12-30 09:45:17 +0800413
Bob Moore33620c52012-02-14 18:14:27 +0800414ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
415 acpi_get_gpe_device(u32 gpe_index,
416 acpi_handle * gpe_device))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700417
Bob Moore33620c52012-02-14 18:14:27 +0800418ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
419 acpi_install_gpe_block(acpi_handle gpe_device,
420 struct
421 acpi_generic_address
422 *gpe_block_address,
423 u32 register_count,
424 u32 interrupt_number))
425ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
426 acpi_remove_gpe_block(acpi_handle gpe_device))
Rafael J. Wysockia2100802010-09-16 00:30:43 +0200427
Linus Torvalds1da177e2005-04-16 15:20:36 -0700428/*
429 * Resource interfaces
430 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700431typedef
Bob Moore616861242006-03-17 16:44:00 -0500432acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource,
Len Brown4be44fc2005-08-05 00:44:28 -0400433 void *context);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700434
435acpi_status
Bob Mooreb47cf582010-04-27 11:54:40 +0800436acpi_get_vendor_resource(acpi_handle device,
Bob Moorec51a4de2005-11-17 13:07:00 -0500437 char *name,
438 struct acpi_vendor_uuid *uuid,
439 struct acpi_buffer *ret_buffer);
440
441acpi_status
Bob Mooreb47cf582010-04-27 11:54:40 +0800442acpi_get_current_resources(acpi_handle device, struct acpi_buffer *ret_buffer);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700443
444#ifdef ACPI_FUTURE_USAGE
445acpi_status
Bob Mooreb47cf582010-04-27 11:54:40 +0800446acpi_get_possible_resources(acpi_handle device, struct acpi_buffer *ret_buffer);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700447#endif
448
449acpi_status
Bob Moorea91cdde2011-11-16 14:46:57 +0800450acpi_get_event_resources(acpi_handle device_handle,
451 struct acpi_buffer *ret_buffer);
452
453acpi_status
Bob Mooreafb1bbe2012-12-31 00:03:58 +0000454acpi_walk_resource_buffer(struct acpi_buffer *buffer,
455 acpi_walk_resource_callback user_function,
456 void *context);
457
458acpi_status
Bob Mooreb47cf582010-04-27 11:54:40 +0800459acpi_walk_resources(acpi_handle device,
Bob Moorec51a4de2005-11-17 13:07:00 -0500460 char *name,
Bob Moore616861242006-03-17 16:44:00 -0500461 acpi_walk_resource_callback user_function, void *context);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700462
463acpi_status
Bob Mooreb47cf582010-04-27 11:54:40 +0800464acpi_set_current_resources(acpi_handle device, struct acpi_buffer *in_buffer);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700465
466acpi_status
Bob Mooreb47cf582010-04-27 11:54:40 +0800467acpi_get_irq_routing_table(acpi_handle device, struct acpi_buffer *ret_buffer);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700468
469acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400470acpi_resource_to_address64(struct acpi_resource *resource,
471 struct acpi_resource_address64 *out);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700472
Bob Moore0e243172011-11-16 14:51:01 +0800473acpi_status
474acpi_buffer_to_resource(u8 *aml_buffer,
475 u16 aml_buffer_length,
476 struct acpi_resource **resource_ptr);
477
Linus Torvalds1da177e2005-04-16 15:20:36 -0700478/*
479 * Hardware (ACPI device) interfaces
480 */
Bob Moored3fd9022008-12-30 11:11:57 +0800481acpi_status acpi_reset(void);
482
Lv Zheng739dcbb2012-12-20 01:07:26 +0000483acpi_status acpi_read(u64 *value, struct acpi_generic_address *reg);
484
485acpi_status acpi_write(u64 value, struct acpi_generic_address *reg);
486
Bob Moore33620c52012-02-14 18:14:27 +0800487ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
488 acpi_read_bit_register(u32 register_id,
489 u32 *return_value))
Len Brown4be44fc2005-08-05 00:44:28 -0400490
Bob Moore33620c52012-02-14 18:14:27 +0800491ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
492 acpi_write_bit_register(u32 register_id,
493 u32 value))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700494
Bob Moore33620c52012-02-14 18:14:27 +0800495/*
496 * Sleep/Wake interfaces
497 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700498acpi_status
Lv Zhengcd27d792013-10-29 09:30:22 +0800499acpi_get_sleep_type_data(u8 sleep_state, u8 *slp_typ_a, u8 *slp_typ_b);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700500
Len Brown4be44fc2005-08-05 00:44:28 -0400501acpi_status acpi_enter_sleep_state_prep(u8 sleep_state);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700502
Lv Zheng40bce102013-10-31 09:31:18 +0800503acpi_status acpi_enter_sleep_state(u8 sleep_state);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700504
Lv Zheng40bce102013-10-31 09:31:18 +0800505ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_enter_sleep_state_s4bios(void))
Linus Torvalds1da177e2005-04-16 15:20:36 -0700506
Len Brown3f6f49c2012-07-26 20:08:54 -0400507acpi_status acpi_leave_sleep_state_prep(u8 sleep_state);
Rafael J. Wysockic95d47a2008-01-08 00:05:21 +0100508
Len Brown4be44fc2005-08-05 00:44:28 -0400509acpi_status acpi_leave_sleep_state(u8 sleep_state);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700510
Lv Zheng739dcbb2012-12-20 01:07:26 +0000511ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
512 acpi_set_firmware_waking_vector(u32
513 physical_address))
Lv Zheng739dcbb2012-12-20 01:07:26 +0000514#if ACPI_MACHINE_WIDTH == 64
515ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
516 acpi_set_firmware_waking_vector64(u64
517 physical_address))
518#endif
Bob Moore50df4d82008-12-31 03:01:23 +0800519/*
Bob Moored08310f2012-02-14 15:22:51 +0800520 * ACPI Timer interfaces
521 */
522#ifdef ACPI_FUTURE_USAGE
Bob Moore33620c52012-02-14 18:14:27 +0800523ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
524 acpi_get_timer_resolution(u32 *resolution))
Bob Moore33620c52012-02-14 18:14:27 +0800525ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status acpi_get_timer(u32 *ticks))
Bob Moored08310f2012-02-14 15:22:51 +0800526
Bob Moore33620c52012-02-14 18:14:27 +0800527ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
528 acpi_get_timer_duration(u32 start_ticks,
529 u32 end_ticks,
530 u32 *time_elapsed))
Bob Moored08310f2012-02-14 15:22:51 +0800531#endif /* ACPI_FUTURE_USAGE */
532
533/*
Bob Mooreb74be612009-04-22 10:20:23 +0800534 * Error/Warning output
Bob Moore50df4d82008-12-31 03:01:23 +0800535 */
Lv Zheng4506bf22013-10-29 09:30:16 +0800536ACPI_PRINTF_LIKE(3)
Bob Moore50df4d82008-12-31 03:01:23 +0800537void ACPI_INTERNAL_VAR_XFACE
Lv Zheng4506bf22013-10-29 09:30:16 +0800538acpi_error(const char *module_name, u32 line_number, const char *format, ...);
Bob Moore50df4d82008-12-31 03:01:23 +0800539
Lv Zheng4506bf22013-10-29 09:30:16 +0800540ACPI_PRINTF_LIKE(4)
Bob Moore50df4d82008-12-31 03:01:23 +0800541void ACPI_INTERNAL_VAR_XFACE
542acpi_exception(const char *module_name,
Lv Zheng4506bf22013-10-29 09:30:16 +0800543 u32 line_number, acpi_status status, const char *format, ...);
Bob Moore50df4d82008-12-31 03:01:23 +0800544
Lv Zheng4506bf22013-10-29 09:30:16 +0800545ACPI_PRINTF_LIKE(3)
Bob Moore50df4d82008-12-31 03:01:23 +0800546void ACPI_INTERNAL_VAR_XFACE
Lv Zheng4506bf22013-10-29 09:30:16 +0800547acpi_warning(const char *module_name, u32 line_number, const char *format, ...);
Bob Moore50df4d82008-12-31 03:01:23 +0800548
Lv Zheng4506bf22013-10-29 09:30:16 +0800549ACPI_PRINTF_LIKE(3)
Bob Moore50df4d82008-12-31 03:01:23 +0800550void ACPI_INTERNAL_VAR_XFACE
Lv Zheng4506bf22013-10-29 09:30:16 +0800551acpi_info(const char *module_name, u32 line_number, const char *format, ...);
Bob Moore50df4d82008-12-31 03:01:23 +0800552
Lv Zheng4506bf22013-10-29 09:30:16 +0800553ACPI_PRINTF_LIKE(3)
Bob Moore62cdd142012-07-16 09:25:27 +0800554void ACPI_INTERNAL_VAR_XFACE
555acpi_bios_error(const char *module_name,
Lv Zheng4506bf22013-10-29 09:30:16 +0800556 u32 line_number, const char *format, ...);
Bob Moore62cdd142012-07-16 09:25:27 +0800557
Lv Zheng4506bf22013-10-29 09:30:16 +0800558ACPI_PRINTF_LIKE(3)
Bob Moore62cdd142012-07-16 09:25:27 +0800559void ACPI_INTERNAL_VAR_XFACE
560acpi_bios_warning(const char *module_name,
Lv Zheng4506bf22013-10-29 09:30:16 +0800561 u32 line_number, const char *format, ...);
Bob Moore62cdd142012-07-16 09:25:27 +0800562
Bob Mooreb74be612009-04-22 10:20:23 +0800563/*
564 * Debug output
565 */
Bob Moore50df4d82008-12-31 03:01:23 +0800566#ifdef ACPI_DEBUG_OUTPUT
567
Lv Zheng4506bf22013-10-29 09:30:16 +0800568ACPI_PRINTF_LIKE(6)
Bob Moore50df4d82008-12-31 03:01:23 +0800569void ACPI_INTERNAL_VAR_XFACE
570acpi_debug_print(u32 requested_debug_level,
571 u32 line_number,
572 const char *function_name,
573 const char *module_name,
Lv Zheng4506bf22013-10-29 09:30:16 +0800574 u32 component_id, const char *format, ...);
Bob Moore50df4d82008-12-31 03:01:23 +0800575
Lv Zheng4506bf22013-10-29 09:30:16 +0800576ACPI_PRINTF_LIKE(6)
Bob Moore50df4d82008-12-31 03:01:23 +0800577void ACPI_INTERNAL_VAR_XFACE
578acpi_debug_print_raw(u32 requested_debug_level,
579 u32 line_number,
580 const char *function_name,
581 const char *module_name,
Lv Zheng4506bf22013-10-29 09:30:16 +0800582 u32 component_id, const char *format, ...);
Bob Moore50df4d82008-12-31 03:01:23 +0800583#endif
584
Bob Moore4ac4c5f2014-02-26 10:28:32 +0800585#pragma pack(pop) /* Restore original struct packing */
586
Len Brown4be44fc2005-08-05 00:44:28 -0400587#endif /* __ACXFACE_H__ */