blob: 7c6d4858bb494efbaa51471d7412b53bb9b301bc [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001
2/******************************************************************************
3 *
4 * Module Name: hwgpe - Low level GPE enable/disable/clear functions
5 *
6 *****************************************************************************/
7
8/*
Bob Moorea8357b02010-01-22 19:07:36 +08009 * Copyright (C) 2000 - 2010, Intel Corp.
Linus Torvalds1da177e2005-04-16 15:20:36 -070010 * 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#include <acpi/acpi.h>
Len Browne2f7a772009-01-09 00:30:03 -050046#include "accommon.h"
47#include "acevents.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
49#define _COMPONENT ACPI_HARDWARE
Len Brown4be44fc2005-08-05 00:44:28 -040050ACPI_MODULE_NAME("hwgpe")
Linus Torvalds1da177e2005-04-16 15:20:36 -070051
Robert Moore44f6c012005-04-18 22:49:35 -040052/* Local prototypes */
Robert Moore44f6c012005-04-18 22:49:35 -040053static acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -040054acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
Bob Mooree97d6bf2008-12-30 09:45:17 +080055 struct acpi_gpe_block_info *gpe_block,
56 void *context);
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
58/******************************************************************************
59 *
Lin Mingb76df672010-07-01 10:07:17 +080060 * FUNCTION: acpi_hw_get_gpe_register_bit
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020061 *
62 * PARAMETERS: gpe_event_info - Info block for the GPE
63 * gpe_register_info - Info block for the GPE register
64 *
65 * RETURN: Status
66 *
67 * DESCRIPTION: Compute GPE enable mask with one bit corresponding to the given
68 * GPE set.
69 *
70 ******************************************************************************/
71
Lin Mingb76df672010-07-01 10:07:17 +080072u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info,
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020073 struct acpi_gpe_register_info *gpe_register_info)
74{
75 return (u32)1 << (gpe_event_info->gpe_number -
76 gpe_register_info->base_gpe_number);
77}
78
79/******************************************************************************
80 *
Rafael J. Wysockifd247442010-06-08 10:49:08 +020081 * FUNCTION: acpi_hw_low_set_gpe
Bob Mooree38e8a02008-06-13 08:28:55 +080082 *
83 * PARAMETERS: gpe_event_info - Info block for the GPE to be disabled
Rafael J. Wysockifd247442010-06-08 10:49:08 +020084 * action - Enable or disable
Bob Mooree38e8a02008-06-13 08:28:55 +080085 *
86 * RETURN: Status
87 *
Rafael J. Wysockifd247442010-06-08 10:49:08 +020088 * DESCRIPTION: Enable or disable a single GPE in its enable register.
Bob Mooree38e8a02008-06-13 08:28:55 +080089 *
90 ******************************************************************************/
91
Rafael J. Wysockifd247442010-06-08 10:49:08 +020092acpi_status
93acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u8 action)
Bob Mooree38e8a02008-06-13 08:28:55 +080094{
95 struct acpi_gpe_register_info *gpe_register_info;
96 acpi_status status;
97 u32 enable_mask;
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020098 u32 register_bit;
Bob Mooree38e8a02008-06-13 08:28:55 +080099
Rafael J. Wysockifd247442010-06-08 10:49:08 +0200100 ACPI_FUNCTION_ENTRY();
101
Bob Mooree38e8a02008-06-13 08:28:55 +0800102 /* Get the info block for the entire GPE register */
103
104 gpe_register_info = gpe_event_info->register_info;
105 if (!gpe_register_info) {
106 return (AE_NOT_EXIST);
107 }
108
109 /* Get current value of the enable register that contains this GPE */
110
Bob Moorec6b57742009-06-24 09:44:06 +0800111 status = acpi_hw_read(&enable_mask, &gpe_register_info->enable_address);
Bob Mooree38e8a02008-06-13 08:28:55 +0800112 if (ACPI_FAILURE(status)) {
113 return (status);
114 }
115
Rafael J. Wysockifd247442010-06-08 10:49:08 +0200116 /* Set ot clear just the bit that corresponds to this GPE */
Bob Mooree38e8a02008-06-13 08:28:55 +0800117
Lin Mingb76df672010-07-01 10:07:17 +0800118 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info,
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200119 gpe_register_info);
Rafael J. Wysockifd247442010-06-08 10:49:08 +0200120 switch (action) {
Lin Ming3a378982010-12-13 13:36:15 +0800121 case ACPI_GPE_CONDITIONAL_ENABLE:
Rafael J. Wysockic9a8bbb2010-06-08 10:49:45 +0200122 if (!(register_bit & gpe_register_info->enable_for_run))
123 return (AE_BAD_PARAMETER);
124
Rafael J. Wysockifd247442010-06-08 10:49:08 +0200125 case ACPI_GPE_ENABLE:
126 ACPI_SET_BIT(enable_mask, register_bit);
127 break;
128
129 case ACPI_GPE_DISABLE:
130 ACPI_CLEAR_BIT(enable_mask, register_bit);
131 break;
132
133 default:
134 ACPI_ERROR((AE_INFO, "Invalid action\n"));
135 return (AE_BAD_PARAMETER);
136 }
Bob Mooree38e8a02008-06-13 08:28:55 +0800137
138 /* Write the updated enable mask */
139
Bob Moorec6b57742009-06-24 09:44:06 +0800140 status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address);
Bob Mooree38e8a02008-06-13 08:28:55 +0800141 return (status);
142}
143
144/******************************************************************************
145 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146 * FUNCTION: acpi_hw_clear_gpe
147 *
148 * PARAMETERS: gpe_event_info - Info block for the GPE to be cleared
149 *
150 * RETURN: Status
151 *
152 * DESCRIPTION: Clear the status bit for a single GPE.
153 *
154 ******************************************************************************/
155
Len Brown4be44fc2005-08-05 00:44:28 -0400156acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700157{
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200158 struct acpi_gpe_register_info *gpe_register_info;
Len Brown4be44fc2005-08-05 00:44:28 -0400159 acpi_status status;
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200160 u32 register_bit;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161
Len Brown4be44fc2005-08-05 00:44:28 -0400162 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200164 /* Get the info block for the entire GPE register */
165
166 gpe_register_info = gpe_event_info->register_info;
167 if (!gpe_register_info) {
168 return (AE_NOT_EXIST);
169 }
170
Lin Mingb76df672010-07-01 10:07:17 +0800171 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info,
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200172 gpe_register_info);
Alexey Starikovskiy69874162007-02-02 19:48:19 +0300173
Linus Torvalds1da177e2005-04-16 15:20:36 -0700174 /*
175 * Write a one to the appropriate bit in the status register to
176 * clear this GPE.
177 */
Bob Moorec6b57742009-06-24 09:44:06 +0800178 status = acpi_hw_write(register_bit,
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200179 &gpe_register_info->status_address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700180
181 return (status);
182}
183
Linus Torvalds1da177e2005-04-16 15:20:36 -0700184/******************************************************************************
185 *
186 * FUNCTION: acpi_hw_get_gpe_status
187 *
188 * PARAMETERS: gpe_event_info - Info block for the GPE to queried
189 * event_status - Where the GPE status is returned
190 *
191 * RETURN: Status
192 *
193 * DESCRIPTION: Return the status of a single GPE.
194 *
195 ******************************************************************************/
Robert Moore44f6c012005-04-18 22:49:35 -0400196
Linus Torvalds1da177e2005-04-16 15:20:36 -0700197acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400198acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
199 acpi_event_status * event_status)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700200{
Len Brown4be44fc2005-08-05 00:44:28 -0400201 u32 in_byte;
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200202 u32 register_bit;
Len Brown4be44fc2005-08-05 00:44:28 -0400203 struct acpi_gpe_register_info *gpe_register_info;
204 acpi_status status;
205 acpi_event_status local_event_status = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700206
Len Brown4be44fc2005-08-05 00:44:28 -0400207 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208
209 if (!event_status) {
210 return (AE_BAD_PARAMETER);
211 }
212
213 /* Get the info block for the entire GPE register */
214
215 gpe_register_info = gpe_event_info->register_info;
216
217 /* Get the register bitmask for this GPE */
218
Lin Mingb76df672010-07-01 10:07:17 +0800219 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info,
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200220 gpe_register_info);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700221
222 /* GPE currently enabled? (enabled for runtime?) */
223
224 if (register_bit & gpe_register_info->enable_for_run) {
225 local_event_status |= ACPI_EVENT_FLAG_ENABLED;
226 }
227
228 /* GPE enabled for wake? */
229
230 if (register_bit & gpe_register_info->enable_for_wake) {
231 local_event_status |= ACPI_EVENT_FLAG_WAKE_ENABLED;
232 }
233
234 /* GPE currently active (status bit == 1)? */
235
Bob Moorec6b57742009-06-24 09:44:06 +0800236 status = acpi_hw_read(&in_byte, &gpe_register_info->status_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400237 if (ACPI_FAILURE(status)) {
Bob Moore2147d3f2010-01-21 09:08:31 +0800238 return (status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239 }
240
241 if (register_bit & in_byte) {
242 local_event_status |= ACPI_EVENT_FLAG_SET;
243 }
244
245 /* Set return value */
246
247 (*event_status) = local_event_status;
Bob Moore2147d3f2010-01-21 09:08:31 +0800248 return (AE_OK);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700249}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250
251/******************************************************************************
252 *
253 * FUNCTION: acpi_hw_disable_gpe_block
254 *
255 * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
256 * gpe_block - Gpe Block info
257 *
258 * RETURN: Status
259 *
Robert Moore44f6c012005-04-18 22:49:35 -0400260 * DESCRIPTION: Disable all GPEs within a single GPE block
Linus Torvalds1da177e2005-04-16 15:20:36 -0700261 *
262 ******************************************************************************/
263
264acpi_status
Bob Mooree97d6bf2008-12-30 09:45:17 +0800265acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
266 struct acpi_gpe_block_info *gpe_block, void *context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700267{
Len Brown4be44fc2005-08-05 00:44:28 -0400268 u32 i;
269 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700270
271 /* Examine each GPE Register within the block */
272
273 for (i = 0; i < gpe_block->register_count; i++) {
Bob Moore52fc0b02006-10-02 00:00:00 -0400274
Linus Torvalds1da177e2005-04-16 15:20:36 -0700275 /* Disable all GPEs in this register */
276
Bob Mooreecfbbc72008-12-31 02:55:32 +0800277 status =
Bob Moorec6b57742009-06-24 09:44:06 +0800278 acpi_hw_write(0x00,
279 &gpe_block->register_info[i].enable_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400280 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700281 return (status);
282 }
283 }
284
285 return (AE_OK);
286}
287
Linus Torvalds1da177e2005-04-16 15:20:36 -0700288/******************************************************************************
289 *
290 * FUNCTION: acpi_hw_clear_gpe_block
291 *
292 * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
293 * gpe_block - Gpe Block info
294 *
295 * RETURN: Status
296 *
Robert Moore44f6c012005-04-18 22:49:35 -0400297 * DESCRIPTION: Clear status bits for all GPEs within a single GPE block
Linus Torvalds1da177e2005-04-16 15:20:36 -0700298 *
299 ******************************************************************************/
300
301acpi_status
Bob Mooree97d6bf2008-12-30 09:45:17 +0800302acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
303 struct acpi_gpe_block_info *gpe_block, void *context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700304{
Len Brown4be44fc2005-08-05 00:44:28 -0400305 u32 i;
306 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700307
308 /* Examine each GPE Register within the block */
309
310 for (i = 0; i < gpe_block->register_count; i++) {
Bob Moore52fc0b02006-10-02 00:00:00 -0400311
Linus Torvalds1da177e2005-04-16 15:20:36 -0700312 /* Clear status on all GPEs in this register */
313
Bob Mooreecfbbc72008-12-31 02:55:32 +0800314 status =
Bob Moorec6b57742009-06-24 09:44:06 +0800315 acpi_hw_write(0xFF,
316 &gpe_block->register_info[i].status_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400317 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700318 return (status);
319 }
320 }
321
322 return (AE_OK);
323}
324
Linus Torvalds1da177e2005-04-16 15:20:36 -0700325/******************************************************************************
326 *
327 * FUNCTION: acpi_hw_enable_runtime_gpe_block
328 *
329 * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
330 * gpe_block - Gpe Block info
331 *
332 * RETURN: Status
333 *
Robert Moore44f6c012005-04-18 22:49:35 -0400334 * DESCRIPTION: Enable all "runtime" GPEs within a single GPE block. Includes
335 * combination wake/run GPEs.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700336 *
337 ******************************************************************************/
338
339acpi_status
Bob Mooree97d6bf2008-12-30 09:45:17 +0800340acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
341 struct acpi_gpe_block_info *gpe_block, void *context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700342{
Len Brown4be44fc2005-08-05 00:44:28 -0400343 u32 i;
344 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700345
346 /* NOTE: assumes that all GPEs are currently disabled */
347
348 /* Examine each GPE Register within the block */
349
350 for (i = 0; i < gpe_block->register_count; i++) {
351 if (!gpe_block->register_info[i].enable_for_run) {
352 continue;
353 }
354
355 /* Enable all "runtime" GPEs in this register */
356
Bob Moorec6b57742009-06-24 09:44:06 +0800357 status =
358 acpi_hw_write(gpe_block->register_info[i].enable_for_run,
359 &gpe_block->register_info[i].enable_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400360 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700361 return (status);
362 }
363 }
364
365 return (AE_OK);
366}
367
Linus Torvalds1da177e2005-04-16 15:20:36 -0700368/******************************************************************************
369 *
370 * FUNCTION: acpi_hw_enable_wakeup_gpe_block
371 *
372 * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
373 * gpe_block - Gpe Block info
374 *
375 * RETURN: Status
376 *
Robert Moore44f6c012005-04-18 22:49:35 -0400377 * DESCRIPTION: Enable all "wake" GPEs within a single GPE block. Includes
378 * combination wake/run GPEs.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700379 *
380 ******************************************************************************/
381
Robert Moore44f6c012005-04-18 22:49:35 -0400382static acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400383acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
Bob Mooree97d6bf2008-12-30 09:45:17 +0800384 struct acpi_gpe_block_info *gpe_block,
385 void *context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700386{
Len Brown4be44fc2005-08-05 00:44:28 -0400387 u32 i;
388 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700389
390 /* Examine each GPE Register within the block */
391
392 for (i = 0; i < gpe_block->register_count; i++) {
393 if (!gpe_block->register_info[i].enable_for_wake) {
394 continue;
395 }
396
397 /* Enable all "wake" GPEs in this register */
398
Bob Moorec6b57742009-06-24 09:44:06 +0800399 status =
400 acpi_hw_write(gpe_block->register_info[i].enable_for_wake,
401 &gpe_block->register_info[i].enable_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400402 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700403 return (status);
404 }
405 }
406
407 return (AE_OK);
408}
409
Linus Torvalds1da177e2005-04-16 15:20:36 -0700410/******************************************************************************
411 *
412 * FUNCTION: acpi_hw_disable_all_gpes
413 *
Robert Moore73459f72005-06-24 00:00:00 -0400414 * PARAMETERS: None
Linus Torvalds1da177e2005-04-16 15:20:36 -0700415 *
416 * RETURN: Status
417 *
Robert Moore44f6c012005-04-18 22:49:35 -0400418 * DESCRIPTION: Disable and clear all GPEs in all GPE blocks
Linus Torvalds1da177e2005-04-16 15:20:36 -0700419 *
420 ******************************************************************************/
421
Len Brown4be44fc2005-08-05 00:44:28 -0400422acpi_status acpi_hw_disable_all_gpes(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700423{
Len Brown4be44fc2005-08-05 00:44:28 -0400424 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700425
Bob Mooreb229cf92006-04-21 17:15:00 -0400426 ACPI_FUNCTION_TRACE(hw_disable_all_gpes);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700427
Bob Mooree97d6bf2008-12-30 09:45:17 +0800428 status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block, NULL);
429 status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block, NULL);
Len Brown4be44fc2005-08-05 00:44:28 -0400430 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700431}
432
Linus Torvalds1da177e2005-04-16 15:20:36 -0700433/******************************************************************************
434 *
435 * FUNCTION: acpi_hw_enable_all_runtime_gpes
436 *
Robert Moore73459f72005-06-24 00:00:00 -0400437 * PARAMETERS: None
Linus Torvalds1da177e2005-04-16 15:20:36 -0700438 *
439 * RETURN: Status
440 *
Robert Moore44f6c012005-04-18 22:49:35 -0400441 * DESCRIPTION: Enable all "runtime" GPEs, in all GPE blocks
Linus Torvalds1da177e2005-04-16 15:20:36 -0700442 *
443 ******************************************************************************/
444
Len Brown4be44fc2005-08-05 00:44:28 -0400445acpi_status acpi_hw_enable_all_runtime_gpes(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700446{
Len Brown4be44fc2005-08-05 00:44:28 -0400447 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700448
Bob Mooreb229cf92006-04-21 17:15:00 -0400449 ACPI_FUNCTION_TRACE(hw_enable_all_runtime_gpes);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700450
Bob Mooree97d6bf2008-12-30 09:45:17 +0800451 status = acpi_ev_walk_gpe_list(acpi_hw_enable_runtime_gpe_block, NULL);
Len Brown4be44fc2005-08-05 00:44:28 -0400452 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700453}
454
Linus Torvalds1da177e2005-04-16 15:20:36 -0700455/******************************************************************************
456 *
457 * FUNCTION: acpi_hw_enable_all_wakeup_gpes
458 *
Robert Moore73459f72005-06-24 00:00:00 -0400459 * PARAMETERS: None
Linus Torvalds1da177e2005-04-16 15:20:36 -0700460 *
461 * RETURN: Status
462 *
Robert Moore44f6c012005-04-18 22:49:35 -0400463 * DESCRIPTION: Enable all "wakeup" GPEs, in all GPE blocks
Linus Torvalds1da177e2005-04-16 15:20:36 -0700464 *
465 ******************************************************************************/
466
Len Brown4be44fc2005-08-05 00:44:28 -0400467acpi_status acpi_hw_enable_all_wakeup_gpes(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700468{
Len Brown4be44fc2005-08-05 00:44:28 -0400469 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700470
Bob Mooreb229cf92006-04-21 17:15:00 -0400471 ACPI_FUNCTION_TRACE(hw_enable_all_wakeup_gpes);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700472
Bob Mooree97d6bf2008-12-30 09:45:17 +0800473 status = acpi_ev_walk_gpe_list(acpi_hw_enable_wakeup_gpe_block, NULL);
Len Brown4be44fc2005-08-05 00:44:28 -0400474 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700475}