Merge master.kernel.org:/pub/scm/linux/kernel/git/dtor/input
[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         u32                             flags);
127
128 acpi_status
129 acpi_ev_delete_gpe_handlers (
130         struct acpi_gpe_xrupt_info      *gpe_xrupt_info,
131         struct acpi_gpe_block_info      *gpe_block);
132
133 acpi_status
134 acpi_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
142 acpi_status
143 acpi_ev_delete_gpe_block (
144         struct acpi_gpe_block_info      *gpe_block);
145
146 u32
147 acpi_ev_gpe_dispatch (
148         struct acpi_gpe_event_info      *gpe_event_info,
149         u32                             gpe_number);
150
151 u32
152 acpi_ev_gpe_detect (
153         struct acpi_gpe_xrupt_info      *gpe_xrupt_list);
154
155 acpi_status
156 acpi_ev_set_gpe_type (
157         struct acpi_gpe_event_info      *gpe_event_info,
158         u8                              type);
159
160 acpi_status
161 acpi_ev_check_for_wake_only_gpe (
162         struct acpi_gpe_event_info      *gpe_event_info);
163
164 acpi_status
165 acpi_ev_gpe_initialize (
166         void);
167
168
169 /*
170  * evregion - Address Space handling
171  */
172 acpi_status
173 acpi_ev_install_region_handlers (
174         void);
175
176 acpi_status
177 acpi_ev_initialize_op_regions (
178         void);
179
180 acpi_status
181 acpi_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
188 acpi_status
189 acpi_ev_attach_region (
190         union acpi_operand_object       *handler_obj,
191         union acpi_operand_object       *region_obj,
192         u8                              acpi_ns_is_locked);
193
194 void
195 acpi_ev_detach_region (
196         union acpi_operand_object      *region_obj,
197         u8                              acpi_ns_is_locked);
198
199 acpi_status
200 acpi_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
207 acpi_status
208 acpi_ev_execute_reg_methods (
209         struct acpi_namespace_node      *node,
210         acpi_adr_space_type             space_id);
211
212 acpi_status
213 acpi_ev_execute_reg_method (
214         union acpi_operand_object      *region_obj,
215         u32                             function);
216
217
218 /*
219  * evregini - Region initialization and setup
220  */
221 acpi_status
222 acpi_ev_system_memory_region_setup (
223         acpi_handle                     handle,
224         u32                             function,
225         void                            *handler_context,
226         void                            **region_context);
227
228 acpi_status
229 acpi_ev_io_space_region_setup (
230         acpi_handle                     handle,
231         u32                             function,
232         void                            *handler_context,
233         void                            **region_context);
234
235 acpi_status
236 acpi_ev_pci_config_region_setup (
237         acpi_handle                     handle,
238         u32                             function,
239         void                            *handler_context,
240         void                            **region_context);
241
242 acpi_status
243 acpi_ev_cmos_region_setup (
244         acpi_handle                     handle,
245         u32                             function,
246         void                            *handler_context,
247         void                            **region_context);
248
249 acpi_status
250 acpi_ev_pci_bar_region_setup (
251         acpi_handle                     handle,
252         u32                             function,
253         void                            *handler_context,
254         void                            **region_context);
255
256 acpi_status
257 acpi_ev_default_region_setup (
258         acpi_handle                     handle,
259         u32                             function,
260         void                            *handler_context,
261         void                            **region_context);
262
263 acpi_status
264 acpi_ev_initialize_region (
265         union acpi_operand_object       *region_obj,
266         u8                              acpi_ns_locked);
267
268
269 /*
270  * evsci - SCI (System Control Interrupt) handling/dispatch
271  */
272 u32 ACPI_SYSTEM_XFACE
273 acpi_ev_gpe_xrupt_handler (
274         void                            *context);
275
276 u32
277 acpi_ev_install_sci_handler (
278         void);
279
280 acpi_status
281 acpi_ev_remove_sci_handler (
282         void);
283
284 u32
285 acpi_ev_initialize_sCI (
286         u32                             program_sCI);
287
288 void
289 acpi_ev_terminate (
290         void);
291
292
293 #endif  /* __ACEVENTS_H__  */