blob: 61a27c8c50795f3d2e46ea3d4c475f7a958f9508 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/******************************************************************************
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
Robert Moore44f6c012005-04-18 22:49:35 -040048/*
49 * evevent
50 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070051acpi_status
52acpi_ev_initialize_events (
53 void);
54
55acpi_status
56acpi_ev_install_xrupt_handlers (
57 void);
58
Linus Torvalds1da177e2005-04-16 15:20:36 -070059u32
60acpi_ev_fixed_event_detect (
61 void);
62
Linus Torvalds1da177e2005-04-16 15:20:36 -070063
64/*
Robert Moore44f6c012005-04-18 22:49:35 -040065 * evmisc
Linus Torvalds1da177e2005-04-16 15:20:36 -070066 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070067u8
68acpi_ev_is_notify_object (
69 struct acpi_namespace_node *node);
70
71acpi_status
72acpi_ev_acquire_global_lock(
73 u16 timeout);
74
75acpi_status
76acpi_ev_release_global_lock(
77 void);
78
79acpi_status
80acpi_ev_init_global_lock_handler (
81 void);
82
83u32
84acpi_ev_get_gpe_number_index (
85 u32 gpe_number);
86
87acpi_status
88acpi_ev_queue_notify_request (
89 struct acpi_namespace_node *node,
90 u32 notify_value);
91
Linus Torvalds1da177e2005-04-16 15:20:36 -070092
93/*
Robert Moore44f6c012005-04-18 22:49:35 -040094 * evgpe - GPE handling and dispatch
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070096acpi_status
97acpi_ev_update_gpe_enable_masks (
98 struct acpi_gpe_event_info *gpe_event_info,
99 u8 type);
100
101acpi_status
102acpi_ev_enable_gpe (
103 struct acpi_gpe_event_info *gpe_event_info,
104 u8 write_to_hardware);
105
106acpi_status
107acpi_ev_disable_gpe (
108 struct acpi_gpe_event_info *gpe_event_info);
109
110struct acpi_gpe_event_info *
111acpi_ev_get_gpe_event_info (
112 acpi_handle gpe_device,
113 u32 gpe_number);
114
Robert Moore44f6c012005-04-18 22:49:35 -0400115
116/*
117 * evgpeblk
118 */
119u8
120acpi_ev_valid_gpe_event (
121 struct acpi_gpe_event_info *gpe_event_info);
122
Linus Torvalds1da177e2005-04-16 15:20:36 -0700123acpi_status
Robert Moore44f6c012005-04-18 22:49:35 -0400124acpi_ev_walk_gpe_list (
125 ACPI_GPE_CALLBACK gpe_walk_callback,
126 u32 flags);
127
128acpi_status
129acpi_ev_delete_gpe_handlers (
130 struct acpi_gpe_xrupt_info *gpe_xrupt_info,
131 struct acpi_gpe_block_info *gpe_block);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700132
133acpi_status
134acpi_ev_create_gpe_block (
135 struct acpi_namespace_node *gpe_device,
136 struct acpi_generic_address *gpe_block_address,
137 u32 register_count,
138 u8 gpe_block_base_number,
139 u32 interrupt_level,
140 struct acpi_gpe_block_info **return_gpe_block);
141
142acpi_status
143acpi_ev_delete_gpe_block (
144 struct acpi_gpe_block_info *gpe_block);
145
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146u32
147acpi_ev_gpe_dispatch (
148 struct acpi_gpe_event_info *gpe_event_info,
149 u32 gpe_number);
150
151u32
152acpi_ev_gpe_detect (
153 struct acpi_gpe_xrupt_info *gpe_xrupt_list);
154
155acpi_status
156acpi_ev_set_gpe_type (
157 struct acpi_gpe_event_info *gpe_event_info,
158 u8 type);
159
160acpi_status
161acpi_ev_check_for_wake_only_gpe (
162 struct acpi_gpe_event_info *gpe_event_info);
163
Robert Moore44f6c012005-04-18 22:49:35 -0400164acpi_status
165acpi_ev_gpe_initialize (
166 void);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700167
Robert Moore44f6c012005-04-18 22:49:35 -0400168
169/*
170 * evregion - Address Space handling
171 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700172acpi_status
173acpi_ev_install_region_handlers (
174 void);
175
176acpi_status
177acpi_ev_initialize_op_regions (
178 void);
179
180acpi_status
181acpi_ev_address_space_dispatch (
182 union acpi_operand_object *region_obj,
183 u32 function,
184 acpi_physical_address address,
185 u32 bit_width,
186 void *value);
187
188acpi_status
Linus Torvalds1da177e2005-04-16 15:20:36 -0700189acpi_ev_attach_region (
190 union acpi_operand_object *handler_obj,
191 union acpi_operand_object *region_obj,
192 u8 acpi_ns_is_locked);
193
194void
195acpi_ev_detach_region (
196 union acpi_operand_object *region_obj,
197 u8 acpi_ns_is_locked);
198
199acpi_status
200acpi_ev_install_space_handler (
201 struct acpi_namespace_node *node,
202 acpi_adr_space_type space_id,
203 acpi_adr_space_handler handler,
204 acpi_adr_space_setup setup,
205 void *context);
206
207acpi_status
208acpi_ev_execute_reg_methods (
209 struct acpi_namespace_node *node,
210 acpi_adr_space_type space_id);
211
212acpi_status
213acpi_ev_execute_reg_method (
214 union acpi_operand_object *region_obj,
215 u32 function);
216
Linus Torvalds1da177e2005-04-16 15:20:36 -0700217
218/*
Robert Moore44f6c012005-04-18 22:49:35 -0400219 * evregini - Region initialization and setup
Linus Torvalds1da177e2005-04-16 15:20:36 -0700220 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700221acpi_status
222acpi_ev_system_memory_region_setup (
223 acpi_handle handle,
224 u32 function,
225 void *handler_context,
226 void **region_context);
227
228acpi_status
229acpi_ev_io_space_region_setup (
230 acpi_handle handle,
231 u32 function,
232 void *handler_context,
233 void **region_context);
234
235acpi_status
236acpi_ev_pci_config_region_setup (
237 acpi_handle handle,
238 u32 function,
239 void *handler_context,
240 void **region_context);
241
242acpi_status
243acpi_ev_cmos_region_setup (
244 acpi_handle handle,
245 u32 function,
246 void *handler_context,
247 void **region_context);
248
249acpi_status
250acpi_ev_pci_bar_region_setup (
251 acpi_handle handle,
252 u32 function,
253 void *handler_context,
254 void **region_context);
255
256acpi_status
257acpi_ev_default_region_setup (
258 acpi_handle handle,
259 u32 function,
260 void *handler_context,
261 void **region_context);
262
263acpi_status
264acpi_ev_initialize_region (
265 union acpi_operand_object *region_obj,
266 u8 acpi_ns_locked);
267
268
269/*
Robert Moore44f6c012005-04-18 22:49:35 -0400270 * evsci - SCI (System Control Interrupt) handling/dispatch
Linus Torvalds1da177e2005-04-16 15:20:36 -0700271 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700272u32 ACPI_SYSTEM_XFACE
273acpi_ev_gpe_xrupt_handler (
274 void *context);
275
276u32
277acpi_ev_install_sci_handler (
278 void);
279
280acpi_status
281acpi_ev_remove_sci_handler (
282 void);
283
284u32
285acpi_ev_initialize_sCI (
286 u32 program_sCI);
287
288void
289acpi_ev_terminate (
290 void);
291
292
293#endif /* __ACEVENTS_H__ */