11da177e4SLinus Torvalds 21da177e4SLinus Torvalds /****************************************************************************** 31da177e4SLinus Torvalds * 41da177e4SLinus Torvalds * Name: acpixf.h - External interfaces to the ACPI subsystem 51da177e4SLinus Torvalds * 61da177e4SLinus Torvalds *****************************************************************************/ 71da177e4SLinus Torvalds 81da177e4SLinus Torvalds /* 975a44ce0SLen Brown * Copyright (C) 2000 - 2008, Intel Corp. 101da177e4SLinus Torvalds * All rights reserved. 111da177e4SLinus Torvalds * 121da177e4SLinus Torvalds * Redistribution and use in source and binary forms, with or without 131da177e4SLinus Torvalds * modification, are permitted provided that the following conditions 141da177e4SLinus Torvalds * are met: 151da177e4SLinus Torvalds * 1. Redistributions of source code must retain the above copyright 161da177e4SLinus Torvalds * notice, this list of conditions, and the following disclaimer, 171da177e4SLinus Torvalds * without modification. 181da177e4SLinus Torvalds * 2. Redistributions in binary form must reproduce at minimum a disclaimer 191da177e4SLinus Torvalds * substantially similar to the "NO WARRANTY" disclaimer below 201da177e4SLinus Torvalds * ("Disclaimer") and any redistribution must be conditioned upon 211da177e4SLinus Torvalds * including a substantially similar Disclaimer requirement for further 221da177e4SLinus Torvalds * binary redistribution. 231da177e4SLinus Torvalds * 3. Neither the names of the above-listed copyright holders nor the names 241da177e4SLinus Torvalds * of any contributors may be used to endorse or promote products derived 251da177e4SLinus Torvalds * from this software without specific prior written permission. 261da177e4SLinus Torvalds * 271da177e4SLinus Torvalds * Alternatively, this software may be distributed under the terms of the 281da177e4SLinus Torvalds * GNU General Public License ("GPL") version 2 as published by the Free 291da177e4SLinus Torvalds * Software Foundation. 301da177e4SLinus Torvalds * 311da177e4SLinus Torvalds * NO WARRANTY 321da177e4SLinus Torvalds * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 331da177e4SLinus Torvalds * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 341da177e4SLinus Torvalds * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 351da177e4SLinus Torvalds * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 361da177e4SLinus Torvalds * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 371da177e4SLinus Torvalds * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 381da177e4SLinus Torvalds * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 391da177e4SLinus Torvalds * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 401da177e4SLinus Torvalds * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 411da177e4SLinus Torvalds * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 421da177e4SLinus Torvalds * POSSIBILITY OF SUCH DAMAGES. 431da177e4SLinus Torvalds */ 441da177e4SLinus Torvalds 451da177e4SLinus Torvalds #ifndef __ACXFACE_H__ 461da177e4SLinus Torvalds #define __ACXFACE_H__ 471da177e4SLinus Torvalds 481da177e4SLinus Torvalds #include "actypes.h" 491da177e4SLinus Torvalds #include "actbl.h" 501da177e4SLinus Torvalds 511da177e4SLinus Torvalds /* 521da177e4SLinus Torvalds * Global interfaces 531da177e4SLinus Torvalds */ 54f3d2e786SBob Moore acpi_status 55f3d2e786SBob Moore acpi_initialize_tables(struct acpi_table_desc *initial_storage, 56f3d2e786SBob Moore u32 initial_table_count, u8 allow_resize); 57f3d2e786SBob Moore 58dd272b57SLen Brown acpi_status __init acpi_initialize_subsystem(void); 591da177e4SLinus Torvalds 604be44fcdSLen Brown acpi_status acpi_enable_subsystem(u32 flags); 611da177e4SLinus Torvalds 624be44fcdSLen Brown acpi_status acpi_initialize_objects(u32 flags); 631da177e4SLinus Torvalds 644be44fcdSLen Brown acpi_status acpi_terminate(void); 651da177e4SLinus Torvalds 661da177e4SLinus Torvalds #ifdef ACPI_FUTURE_USAGE 674be44fcdSLen Brown acpi_status acpi_subsystem_status(void); 681da177e4SLinus Torvalds #endif 691da177e4SLinus Torvalds 704be44fcdSLen Brown acpi_status acpi_enable(void); 711da177e4SLinus Torvalds 724be44fcdSLen Brown acpi_status acpi_disable(void); 731da177e4SLinus Torvalds 741da177e4SLinus Torvalds #ifdef ACPI_FUTURE_USAGE 754be44fcdSLen Brown acpi_status acpi_get_system_info(struct acpi_buffer *ret_buffer); 761da177e4SLinus Torvalds #endif 771da177e4SLinus Torvalds 784be44fcdSLen Brown const char *acpi_format_exception(acpi_status exception); 791da177e4SLinus Torvalds 804be44fcdSLen Brown acpi_status acpi_purge_cached_objects(void); 811da177e4SLinus Torvalds 821da177e4SLinus Torvalds #ifdef ACPI_FUTURE_USAGE 831da177e4SLinus Torvalds acpi_status 844be44fcdSLen Brown acpi_install_initialization_handler(acpi_init_handler handler, u32 function); 851da177e4SLinus Torvalds #endif 861da177e4SLinus Torvalds 871da177e4SLinus Torvalds /* 88aee07ba6SJoe Perches * ACPI Memory management 891da177e4SLinus Torvalds */ 904be44fcdSLen Brown void *acpi_allocate(u32 size); 911da177e4SLinus Torvalds 924be44fcdSLen Brown void *acpi_callocate(u32 size); 931da177e4SLinus Torvalds 944be44fcdSLen Brown void acpi_free(void *address); 951da177e4SLinus Torvalds 961da177e4SLinus Torvalds /* 971da177e4SLinus Torvalds * ACPI table manipulation interfaces 981da177e4SLinus Torvalds */ 99f3d2e786SBob Moore acpi_status acpi_reallocate_root_table(void); 100f3d2e786SBob Moore 10167a119f9SBob Moore acpi_status acpi_find_root_pointer(acpi_size *rsdp_address); 1021da177e4SLinus Torvalds 1034be44fcdSLen Brown acpi_status acpi_load_tables(void); 1041da177e4SLinus Torvalds 1054be44fcdSLen Brown acpi_status acpi_load_table(struct acpi_table_header *table_ptr); 1064be44fcdSLen Brown 107f3d2e786SBob Moore acpi_status acpi_unload_table_id(acpi_owner_id id); 1081da177e4SLinus Torvalds 1091da177e4SLinus Torvalds acpi_status 110f3d2e786SBob Moore acpi_get_table_header(acpi_string signature, 11167a119f9SBob Moore u32 instance, 112428f2112SAlexey Starikovskiy struct acpi_table_header *out_table_header); 1131da177e4SLinus Torvalds 1141da177e4SLinus Torvalds acpi_status 115f3d2e786SBob Moore acpi_get_table(acpi_string signature, 11667a119f9SBob Moore u32 instance, struct acpi_table_header **out_table); 117f3d2e786SBob Moore 118f3d2e786SBob Moore acpi_status 11967a119f9SBob Moore acpi_get_table_by_index(u32 table_index, 120f3d2e786SBob Moore struct acpi_table_header **out_table); 1211da177e4SLinus Torvalds 1223e08e2d2SLin Ming acpi_status 1233e08e2d2SLin Ming acpi_install_table_handler(acpi_tbl_handler handler, void *context); 1243e08e2d2SLin Ming 1253e08e2d2SLin Ming acpi_status acpi_remove_table_handler(acpi_tbl_handler handler); 1263e08e2d2SLin Ming 1271da177e4SLinus Torvalds /* 1281da177e4SLinus Torvalds * Namespace and name interfaces 1291da177e4SLinus Torvalds */ 1301da177e4SLinus Torvalds acpi_status 1314be44fcdSLen Brown acpi_walk_namespace(acpi_object_type type, 1321da177e4SLinus Torvalds acpi_handle start_object, 1331da177e4SLinus Torvalds u32 max_depth, 1341da177e4SLinus Torvalds acpi_walk_callback user_function, 1354be44fcdSLen Brown void *context, void **return_value); 1361da177e4SLinus Torvalds 1371da177e4SLinus Torvalds acpi_status 13870b30fb1SAl Viro acpi_get_devices(const char *HID, 1391da177e4SLinus Torvalds acpi_walk_callback user_function, 1404be44fcdSLen Brown void *context, void **return_value); 1411da177e4SLinus Torvalds 1421da177e4SLinus Torvalds acpi_status 1434be44fcdSLen Brown acpi_get_name(acpi_handle handle, 1444be44fcdSLen Brown u32 name_type, struct acpi_buffer *ret_path_ptr); 1451da177e4SLinus Torvalds 1461da177e4SLinus Torvalds acpi_status 1474be44fcdSLen Brown acpi_get_handle(acpi_handle parent, 1484be44fcdSLen Brown acpi_string pathname, acpi_handle * ret_handle); 1491da177e4SLinus Torvalds 1501da177e4SLinus Torvalds acpi_status 1514be44fcdSLen Brown acpi_attach_data(acpi_handle obj_handle, 1524be44fcdSLen Brown acpi_object_handler handler, void *data); 1531da177e4SLinus Torvalds 1541da177e4SLinus Torvalds acpi_status 1554be44fcdSLen Brown acpi_detach_data(acpi_handle obj_handle, acpi_object_handler handler); 1561da177e4SLinus Torvalds 1571da177e4SLinus Torvalds acpi_status 1584be44fcdSLen Brown acpi_get_data(acpi_handle obj_handle, acpi_object_handler handler, void **data); 1591da177e4SLinus Torvalds 16050eca3ebSBob Moore acpi_status 16150eca3ebSBob Moore acpi_debug_trace(char *name, u32 debug_level, u32 debug_layer, u32 flags); 16250eca3ebSBob Moore 1631da177e4SLinus Torvalds /* 1641da177e4SLinus Torvalds * Object manipulation and enumeration 1651da177e4SLinus Torvalds */ 1661da177e4SLinus Torvalds acpi_status 1674be44fcdSLen Brown acpi_evaluate_object(acpi_handle object, 1681da177e4SLinus Torvalds acpi_string pathname, 1691da177e4SLinus Torvalds struct acpi_object_list *parameter_objects, 1701da177e4SLinus Torvalds struct acpi_buffer *return_object_buffer); 1711da177e4SLinus Torvalds 1721da177e4SLinus Torvalds #ifdef ACPI_FUTURE_USAGE 1731da177e4SLinus Torvalds acpi_status 1744be44fcdSLen Brown acpi_evaluate_object_typed(acpi_handle object, 1751da177e4SLinus Torvalds acpi_string pathname, 1761da177e4SLinus Torvalds struct acpi_object_list *external_params, 1771da177e4SLinus Torvalds struct acpi_buffer *return_buffer, 1781da177e4SLinus Torvalds acpi_object_type return_type); 1791da177e4SLinus Torvalds #endif 1801da177e4SLinus Torvalds 1811da177e4SLinus Torvalds acpi_status 1824be44fcdSLen Brown acpi_get_object_info(acpi_handle handle, struct acpi_buffer *return_buffer); 1831da177e4SLinus Torvalds 1841da177e4SLinus Torvalds acpi_status 1854be44fcdSLen Brown acpi_get_next_object(acpi_object_type type, 1861da177e4SLinus Torvalds acpi_handle parent, 1874be44fcdSLen Brown acpi_handle child, acpi_handle * out_handle); 1881da177e4SLinus Torvalds 1894be44fcdSLen Brown acpi_status acpi_get_type(acpi_handle object, acpi_object_type * out_type); 1901da177e4SLinus Torvalds 1910f0fe1a0SJohn Keller acpi_status acpi_get_id(acpi_handle object, acpi_owner_id * out_type); 1920f0fe1a0SJohn Keller 1934be44fcdSLen Brown acpi_status acpi_get_parent(acpi_handle object, acpi_handle * out_handle); 1941da177e4SLinus Torvalds 1951da177e4SLinus Torvalds /* 1961da177e4SLinus Torvalds * Event handler interfaces 1971da177e4SLinus Torvalds */ 1981da177e4SLinus Torvalds acpi_status 1994be44fcdSLen Brown acpi_install_fixed_event_handler(u32 acpi_event, 2004be44fcdSLen Brown acpi_event_handler handler, void *context); 2011da177e4SLinus Torvalds 2021da177e4SLinus Torvalds acpi_status 2034be44fcdSLen Brown acpi_remove_fixed_event_handler(u32 acpi_event, acpi_event_handler handler); 2041da177e4SLinus Torvalds 2051da177e4SLinus Torvalds acpi_status 2064be44fcdSLen Brown acpi_install_notify_handler(acpi_handle device, 2071da177e4SLinus Torvalds u32 handler_type, 2084be44fcdSLen Brown acpi_notify_handler handler, void *context); 2091da177e4SLinus Torvalds 2101da177e4SLinus Torvalds acpi_status 2114be44fcdSLen Brown acpi_remove_notify_handler(acpi_handle device, 2124be44fcdSLen Brown u32 handler_type, acpi_notify_handler handler); 2131da177e4SLinus Torvalds 2141da177e4SLinus Torvalds acpi_status 2154be44fcdSLen Brown acpi_install_address_space_handler(acpi_handle device, 2161da177e4SLinus Torvalds acpi_adr_space_type space_id, 2171da177e4SLinus Torvalds acpi_adr_space_handler handler, 2184be44fcdSLen Brown acpi_adr_space_setup setup, void *context); 2191da177e4SLinus Torvalds 2201da177e4SLinus Torvalds acpi_status 2214be44fcdSLen Brown acpi_remove_address_space_handler(acpi_handle device, 2221da177e4SLinus Torvalds acpi_adr_space_type space_id, 2231da177e4SLinus Torvalds acpi_adr_space_handler handler); 2241da177e4SLinus Torvalds 2251da177e4SLinus Torvalds acpi_status 2264be44fcdSLen Brown acpi_install_gpe_handler(acpi_handle gpe_device, 2271da177e4SLinus Torvalds u32 gpe_number, 2284be44fcdSLen Brown u32 type, acpi_event_handler address, void *context); 2291da177e4SLinus Torvalds 2301da177e4SLinus Torvalds #ifdef ACPI_FUTURE_USAGE 2314be44fcdSLen Brown acpi_status acpi_install_exception_handler(acpi_exception_handler handler); 2321da177e4SLinus Torvalds #endif 2331da177e4SLinus Torvalds 2341da177e4SLinus Torvalds /* 2351da177e4SLinus Torvalds * Event interfaces 2361da177e4SLinus Torvalds */ 2374be44fcdSLen Brown acpi_status acpi_acquire_global_lock(u16 timeout, u32 * handle); 2384be44fcdSLen Brown 2394be44fcdSLen Brown acpi_status acpi_release_global_lock(u32 handle); 2401da177e4SLinus Torvalds 2411da177e4SLinus Torvalds acpi_status 2424be44fcdSLen Brown acpi_remove_gpe_handler(acpi_handle gpe_device, 2434be44fcdSLen Brown u32 gpe_number, acpi_event_handler address); 2441da177e4SLinus Torvalds 2454be44fcdSLen Brown acpi_status acpi_enable_event(u32 event, u32 flags); 2461da177e4SLinus Torvalds 2474be44fcdSLen Brown acpi_status acpi_disable_event(u32 event, u32 flags); 2481da177e4SLinus Torvalds 2494be44fcdSLen Brown acpi_status acpi_clear_event(u32 event); 2501da177e4SLinus Torvalds 2514be44fcdSLen Brown acpi_status acpi_get_event_status(u32 event, acpi_event_status * event_status); 2524be44fcdSLen Brown 2534be44fcdSLen Brown acpi_status acpi_set_gpe_type(acpi_handle gpe_device, u32 gpe_number, u8 type); 2544be44fcdSLen Brown 2550b7084acSAlexey Starikovskiy acpi_status acpi_enable_gpe(acpi_handle gpe_device, u32 gpe_number); 2564be44fcdSLen Brown 2570b7084acSAlexey Starikovskiy acpi_status acpi_disable_gpe(acpi_handle gpe_device, u32 gpe_number); 2584be44fcdSLen Brown 2594be44fcdSLen Brown acpi_status acpi_clear_gpe(acpi_handle gpe_device, u32 gpe_number, u32 flags); 2601da177e4SLinus Torvalds 2611da177e4SLinus Torvalds acpi_status 2624be44fcdSLen Brown acpi_get_gpe_status(acpi_handle gpe_device, 2634be44fcdSLen Brown u32 gpe_number, 2644be44fcdSLen Brown u32 flags, acpi_event_status * event_status); 2651da177e4SLinus Torvalds 2661da177e4SLinus Torvalds acpi_status 2674be44fcdSLen Brown acpi_install_gpe_block(acpi_handle gpe_device, 2681da177e4SLinus Torvalds struct acpi_generic_address *gpe_block_address, 2694be44fcdSLen Brown u32 register_count, u32 interrupt_number); 2701da177e4SLinus Torvalds 2714be44fcdSLen Brown acpi_status acpi_remove_gpe_block(acpi_handle gpe_device); 2721da177e4SLinus Torvalds 2731da177e4SLinus Torvalds /* 2741da177e4SLinus Torvalds * Resource interfaces 2751da177e4SLinus Torvalds */ 2761da177e4SLinus Torvalds typedef 27761686124SBob Moore acpi_status(*acpi_walk_resource_callback) (struct acpi_resource * resource, 2781da177e4SLinus Torvalds void *context); 2791da177e4SLinus Torvalds 2801da177e4SLinus Torvalds acpi_status 281c51a4de8SBob Moore acpi_get_vendor_resource(acpi_handle device_handle, 282c51a4de8SBob Moore char *name, 283c51a4de8SBob Moore struct acpi_vendor_uuid *uuid, 284c51a4de8SBob Moore struct acpi_buffer *ret_buffer); 285c51a4de8SBob Moore 286c51a4de8SBob Moore acpi_status 2874be44fcdSLen Brown acpi_get_current_resources(acpi_handle device_handle, 2881da177e4SLinus Torvalds struct acpi_buffer *ret_buffer); 2891da177e4SLinus Torvalds 2901da177e4SLinus Torvalds #ifdef ACPI_FUTURE_USAGE 2911da177e4SLinus Torvalds acpi_status 2924be44fcdSLen Brown acpi_get_possible_resources(acpi_handle device_handle, 2931da177e4SLinus Torvalds struct acpi_buffer *ret_buffer); 2941da177e4SLinus Torvalds #endif 2951da177e4SLinus Torvalds 2961da177e4SLinus Torvalds acpi_status 2974be44fcdSLen Brown acpi_walk_resources(acpi_handle device_handle, 298c51a4de8SBob Moore char *name, 29961686124SBob Moore acpi_walk_resource_callback user_function, void *context); 3001da177e4SLinus Torvalds 3011da177e4SLinus Torvalds acpi_status 3024be44fcdSLen Brown acpi_set_current_resources(acpi_handle device_handle, 3031da177e4SLinus Torvalds struct acpi_buffer *in_buffer); 3041da177e4SLinus Torvalds 3051da177e4SLinus Torvalds acpi_status 3064be44fcdSLen Brown acpi_get_irq_routing_table(acpi_handle bus_device_handle, 3071da177e4SLinus Torvalds struct acpi_buffer *ret_buffer); 3081da177e4SLinus Torvalds 3091da177e4SLinus Torvalds acpi_status 3104be44fcdSLen Brown acpi_resource_to_address64(struct acpi_resource *resource, 3111da177e4SLinus Torvalds struct acpi_resource_address64 *out); 3121da177e4SLinus Torvalds 3131da177e4SLinus Torvalds /* 3141da177e4SLinus Torvalds * Hardware (ACPI device) interfaces 3151da177e4SLinus Torvalds */ 316d8c71b6dSBob Moore acpi_status acpi_get_register(u32 register_id, u32 * return_value); 3174be44fcdSLen Brown 3182d571b33SAlexey Starikovskiy acpi_status acpi_get_register_unlocked(u32 register_id, u32 *return_value); 3192d571b33SAlexey Starikovskiy 320d8c71b6dSBob Moore acpi_status acpi_set_register(u32 register_id, u32 value); 3211da177e4SLinus Torvalds 3221da177e4SLinus Torvalds acpi_status 323*d85988faSBob Moore acpi_set_firmware_waking_vector(u32 physical_address); 3241da177e4SLinus Torvalds 3251da177e4SLinus Torvalds acpi_status 326*d85988faSBob Moore acpi_set_firmware_waking_vector64(u64 physical_address); 3271da177e4SLinus Torvalds 3281da177e4SLinus Torvalds acpi_status 3294be44fcdSLen Brown acpi_get_sleep_type_data(u8 sleep_state, u8 * slp_typ_a, u8 * slp_typ_b); 3301da177e4SLinus Torvalds 3314be44fcdSLen Brown acpi_status acpi_enter_sleep_state_prep(u8 sleep_state); 3321da177e4SLinus Torvalds 3334be44fcdSLen Brown acpi_status asmlinkage acpi_enter_sleep_state(u8 sleep_state); 3341da177e4SLinus Torvalds 3354be44fcdSLen Brown acpi_status asmlinkage acpi_enter_sleep_state_s4bios(void); 3361da177e4SLinus Torvalds 337c95d47a8SRafael J. Wysocki acpi_status acpi_leave_sleep_state_prep(u8 sleep_state); 338c95d47a8SRafael J. Wysocki 3394be44fcdSLen Brown acpi_status acpi_leave_sleep_state(u8 sleep_state); 3401da177e4SLinus Torvalds 3411da177e4SLinus Torvalds #endif /* __ACXFACE_H__ */ 342