blob: 3450309c2786ca490d47eb6952059f8ae2eb89f8 [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 *
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020060 * FUNCTION: acpi_hw_gpe_register_bit
61 *
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
72u32 acpi_hw_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info,
73 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
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200118 register_bit = acpi_hw_gpe_register_bit(gpe_event_info,
119 gpe_register_info);
Rafael J. Wysockifd247442010-06-08 10:49:08 +0200120 switch (action) {
Rafael J. Wysockic9a8bbb2010-06-08 10:49:45 +0200121 case ACPI_GPE_COND_ENABLE:
122 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_write_gpe_enable_reg
147 *
148 * PARAMETERS: gpe_event_info - Info block for the GPE to be enabled
149 *
150 * RETURN: Status
151 *
152 * DESCRIPTION: Write a GPE enable register. Note: The bit for this GPE must
153 * already be cleared or set in the parent register
154 * enable_for_run mask.
155 *
156 ******************************************************************************/
157
158acpi_status
Bob Mooree38e8a02008-06-13 08:28:55 +0800159acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info * gpe_event_info)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160{
Len Brown4be44fc2005-08-05 00:44:28 -0400161 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700162
Len Brown4be44fc2005-08-05 00:44:28 -0400163 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164
Rafael J. Wysockic9a8bbb2010-06-08 10:49:45 +0200165 status = acpi_hw_low_set_gpe(gpe_event_info, ACPI_GPE_COND_ENABLE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166 return (status);
167}
168
Linus Torvalds1da177e2005-04-16 15:20:36 -0700169/******************************************************************************
170 *
171 * FUNCTION: acpi_hw_clear_gpe
172 *
173 * PARAMETERS: gpe_event_info - Info block for the GPE to be cleared
174 *
175 * RETURN: Status
176 *
177 * DESCRIPTION: Clear the status bit for a single GPE.
178 *
179 ******************************************************************************/
180
Len Brown4be44fc2005-08-05 00:44:28 -0400181acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700182{
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200183 struct acpi_gpe_register_info *gpe_register_info;
Len Brown4be44fc2005-08-05 00:44:28 -0400184 acpi_status status;
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200185 u32 register_bit;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700186
Len Brown4be44fc2005-08-05 00:44:28 -0400187 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200189 /* Get the info block for the entire GPE register */
190
191 gpe_register_info = gpe_event_info->register_info;
192 if (!gpe_register_info) {
193 return (AE_NOT_EXIST);
194 }
195
196 register_bit = acpi_hw_gpe_register_bit(gpe_event_info,
197 gpe_register_info);
Alexey Starikovskiy69874162007-02-02 19:48:19 +0300198
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199 /*
200 * Write a one to the appropriate bit in the status register to
201 * clear this GPE.
202 */
Bob Moorec6b57742009-06-24 09:44:06 +0800203 status = acpi_hw_write(register_bit,
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200204 &gpe_register_info->status_address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700205
206 return (status);
207}
208
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209/******************************************************************************
210 *
211 * FUNCTION: acpi_hw_get_gpe_status
212 *
213 * PARAMETERS: gpe_event_info - Info block for the GPE to queried
214 * event_status - Where the GPE status is returned
215 *
216 * RETURN: Status
217 *
218 * DESCRIPTION: Return the status of a single GPE.
219 *
220 ******************************************************************************/
Robert Moore44f6c012005-04-18 22:49:35 -0400221
Linus Torvalds1da177e2005-04-16 15:20:36 -0700222acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400223acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
224 acpi_event_status * event_status)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225{
Len Brown4be44fc2005-08-05 00:44:28 -0400226 u32 in_byte;
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200227 u32 register_bit;
Len Brown4be44fc2005-08-05 00:44:28 -0400228 struct acpi_gpe_register_info *gpe_register_info;
229 acpi_status status;
230 acpi_event_status local_event_status = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700231
Len Brown4be44fc2005-08-05 00:44:28 -0400232 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700233
234 if (!event_status) {
235 return (AE_BAD_PARAMETER);
236 }
237
238 /* Get the info block for the entire GPE register */
239
240 gpe_register_info = gpe_event_info->register_info;
241
242 /* Get the register bitmask for this GPE */
243
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200244 register_bit = acpi_hw_gpe_register_bit(gpe_event_info,
245 gpe_register_info);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246
247 /* GPE currently enabled? (enabled for runtime?) */
248
249 if (register_bit & gpe_register_info->enable_for_run) {
250 local_event_status |= ACPI_EVENT_FLAG_ENABLED;
251 }
252
253 /* GPE enabled for wake? */
254
255 if (register_bit & gpe_register_info->enable_for_wake) {
256 local_event_status |= ACPI_EVENT_FLAG_WAKE_ENABLED;
257 }
258
259 /* GPE currently active (status bit == 1)? */
260
Bob Moorec6b57742009-06-24 09:44:06 +0800261 status = acpi_hw_read(&in_byte, &gpe_register_info->status_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400262 if (ACPI_FAILURE(status)) {
Bob Moore2147d3f2010-01-21 09:08:31 +0800263 return (status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700264 }
265
266 if (register_bit & in_byte) {
267 local_event_status |= ACPI_EVENT_FLAG_SET;
268 }
269
270 /* Set return value */
271
272 (*event_status) = local_event_status;
Bob Moore2147d3f2010-01-21 09:08:31 +0800273 return (AE_OK);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700274}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700275
276/******************************************************************************
277 *
278 * FUNCTION: acpi_hw_disable_gpe_block
279 *
280 * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
281 * gpe_block - Gpe Block info
282 *
283 * RETURN: Status
284 *
Robert Moore44f6c012005-04-18 22:49:35 -0400285 * DESCRIPTION: Disable all GPEs within a single GPE block
Linus Torvalds1da177e2005-04-16 15:20:36 -0700286 *
287 ******************************************************************************/
288
289acpi_status
Bob Mooree97d6bf2008-12-30 09:45:17 +0800290acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
291 struct acpi_gpe_block_info *gpe_block, void *context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700292{
Len Brown4be44fc2005-08-05 00:44:28 -0400293 u32 i;
294 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700295
296 /* Examine each GPE Register within the block */
297
298 for (i = 0; i < gpe_block->register_count; i++) {
Bob Moore52fc0b02006-10-02 00:00:00 -0400299
Linus Torvalds1da177e2005-04-16 15:20:36 -0700300 /* Disable all GPEs in this register */
301
Bob Mooreecfbbc72008-12-31 02:55:32 +0800302 status =
Bob Moorec6b57742009-06-24 09:44:06 +0800303 acpi_hw_write(0x00,
304 &gpe_block->register_info[i].enable_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400305 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700306 return (status);
307 }
308 }
309
310 return (AE_OK);
311}
312
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313/******************************************************************************
314 *
315 * FUNCTION: acpi_hw_clear_gpe_block
316 *
317 * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
318 * gpe_block - Gpe Block info
319 *
320 * RETURN: Status
321 *
Robert Moore44f6c012005-04-18 22:49:35 -0400322 * DESCRIPTION: Clear status bits for all GPEs within a single GPE block
Linus Torvalds1da177e2005-04-16 15:20:36 -0700323 *
324 ******************************************************************************/
325
326acpi_status
Bob Mooree97d6bf2008-12-30 09:45:17 +0800327acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
328 struct acpi_gpe_block_info *gpe_block, void *context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700329{
Len Brown4be44fc2005-08-05 00:44:28 -0400330 u32 i;
331 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700332
333 /* Examine each GPE Register within the block */
334
335 for (i = 0; i < gpe_block->register_count; i++) {
Bob Moore52fc0b02006-10-02 00:00:00 -0400336
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337 /* Clear status on all GPEs in this register */
338
Bob Mooreecfbbc72008-12-31 02:55:32 +0800339 status =
Bob Moorec6b57742009-06-24 09:44:06 +0800340 acpi_hw_write(0xFF,
341 &gpe_block->register_info[i].status_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400342 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700343 return (status);
344 }
345 }
346
347 return (AE_OK);
348}
349
Linus Torvalds1da177e2005-04-16 15:20:36 -0700350/******************************************************************************
351 *
352 * FUNCTION: acpi_hw_enable_runtime_gpe_block
353 *
354 * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
355 * gpe_block - Gpe Block info
356 *
357 * RETURN: Status
358 *
Robert Moore44f6c012005-04-18 22:49:35 -0400359 * DESCRIPTION: Enable all "runtime" GPEs within a single GPE block. Includes
360 * combination wake/run GPEs.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700361 *
362 ******************************************************************************/
363
364acpi_status
Bob Mooree97d6bf2008-12-30 09:45:17 +0800365acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
366 struct acpi_gpe_block_info *gpe_block, void *context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700367{
Len Brown4be44fc2005-08-05 00:44:28 -0400368 u32 i;
369 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700370
371 /* NOTE: assumes that all GPEs are currently disabled */
372
373 /* Examine each GPE Register within the block */
374
375 for (i = 0; i < gpe_block->register_count; i++) {
376 if (!gpe_block->register_info[i].enable_for_run) {
377 continue;
378 }
379
380 /* Enable all "runtime" GPEs in this register */
381
Bob Moorec6b57742009-06-24 09:44:06 +0800382 status =
383 acpi_hw_write(gpe_block->register_info[i].enable_for_run,
384 &gpe_block->register_info[i].enable_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400385 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700386 return (status);
387 }
388 }
389
390 return (AE_OK);
391}
392
Linus Torvalds1da177e2005-04-16 15:20:36 -0700393/******************************************************************************
394 *
395 * FUNCTION: acpi_hw_enable_wakeup_gpe_block
396 *
397 * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
398 * gpe_block - Gpe Block info
399 *
400 * RETURN: Status
401 *
Robert Moore44f6c012005-04-18 22:49:35 -0400402 * DESCRIPTION: Enable all "wake" GPEs within a single GPE block. Includes
403 * combination wake/run GPEs.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700404 *
405 ******************************************************************************/
406
Robert Moore44f6c012005-04-18 22:49:35 -0400407static acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400408acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
Bob Mooree97d6bf2008-12-30 09:45:17 +0800409 struct acpi_gpe_block_info *gpe_block,
410 void *context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411{
Len Brown4be44fc2005-08-05 00:44:28 -0400412 u32 i;
413 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700414
415 /* Examine each GPE Register within the block */
416
417 for (i = 0; i < gpe_block->register_count; i++) {
418 if (!gpe_block->register_info[i].enable_for_wake) {
419 continue;
420 }
421
422 /* Enable all "wake" GPEs in this register */
423
Bob Moorec6b57742009-06-24 09:44:06 +0800424 status =
425 acpi_hw_write(gpe_block->register_info[i].enable_for_wake,
426 &gpe_block->register_info[i].enable_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400427 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700428 return (status);
429 }
430 }
431
432 return (AE_OK);
433}
434
Linus Torvalds1da177e2005-04-16 15:20:36 -0700435/******************************************************************************
436 *
437 * FUNCTION: acpi_hw_disable_all_gpes
438 *
Robert Moore73459f72005-06-24 00:00:00 -0400439 * PARAMETERS: None
Linus Torvalds1da177e2005-04-16 15:20:36 -0700440 *
441 * RETURN: Status
442 *
Robert Moore44f6c012005-04-18 22:49:35 -0400443 * DESCRIPTION: Disable and clear all GPEs in all GPE blocks
Linus Torvalds1da177e2005-04-16 15:20:36 -0700444 *
445 ******************************************************************************/
446
Len Brown4be44fc2005-08-05 00:44:28 -0400447acpi_status acpi_hw_disable_all_gpes(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700448{
Len Brown4be44fc2005-08-05 00:44:28 -0400449 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700450
Bob Mooreb229cf92006-04-21 17:15:00 -0400451 ACPI_FUNCTION_TRACE(hw_disable_all_gpes);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700452
Bob Mooree97d6bf2008-12-30 09:45:17 +0800453 status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block, NULL);
454 status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block, NULL);
Len Brown4be44fc2005-08-05 00:44:28 -0400455 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700456}
457
Linus Torvalds1da177e2005-04-16 15:20:36 -0700458/******************************************************************************
459 *
460 * FUNCTION: acpi_hw_enable_all_runtime_gpes
461 *
Robert Moore73459f72005-06-24 00:00:00 -0400462 * PARAMETERS: None
Linus Torvalds1da177e2005-04-16 15:20:36 -0700463 *
464 * RETURN: Status
465 *
Robert Moore44f6c012005-04-18 22:49:35 -0400466 * DESCRIPTION: Enable all "runtime" GPEs, in all GPE blocks
Linus Torvalds1da177e2005-04-16 15:20:36 -0700467 *
468 ******************************************************************************/
469
Len Brown4be44fc2005-08-05 00:44:28 -0400470acpi_status acpi_hw_enable_all_runtime_gpes(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700471{
Len Brown4be44fc2005-08-05 00:44:28 -0400472 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700473
Bob Mooreb229cf92006-04-21 17:15:00 -0400474 ACPI_FUNCTION_TRACE(hw_enable_all_runtime_gpes);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700475
Bob Mooree97d6bf2008-12-30 09:45:17 +0800476 status = acpi_ev_walk_gpe_list(acpi_hw_enable_runtime_gpe_block, NULL);
Len Brown4be44fc2005-08-05 00:44:28 -0400477 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700478}
479
Linus Torvalds1da177e2005-04-16 15:20:36 -0700480/******************************************************************************
481 *
482 * FUNCTION: acpi_hw_enable_all_wakeup_gpes
483 *
Robert Moore73459f72005-06-24 00:00:00 -0400484 * PARAMETERS: None
Linus Torvalds1da177e2005-04-16 15:20:36 -0700485 *
486 * RETURN: Status
487 *
Robert Moore44f6c012005-04-18 22:49:35 -0400488 * DESCRIPTION: Enable all "wakeup" GPEs, in all GPE blocks
Linus Torvalds1da177e2005-04-16 15:20:36 -0700489 *
490 ******************************************************************************/
491
Len Brown4be44fc2005-08-05 00:44:28 -0400492acpi_status acpi_hw_enable_all_wakeup_gpes(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700493{
Len Brown4be44fc2005-08-05 00:44:28 -0400494 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700495
Bob Mooreb229cf92006-04-21 17:15:00 -0400496 ACPI_FUNCTION_TRACE(hw_enable_all_wakeup_gpes);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700497
Bob Mooree97d6bf2008-12-30 09:45:17 +0800498 status = acpi_ev_walk_gpe_list(acpi_hw_enable_wakeup_gpe_block, NULL);
Len Brown4be44fc2005-08-05 00:44:28 -0400499 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700500}