blob: 40388e23e103963b0eb1d56dcb2f7e305ea640d2 [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) {
121 case ACPI_GPE_ENABLE:
122 ACPI_SET_BIT(enable_mask, register_bit);
123 break;
124
125 case ACPI_GPE_DISABLE:
126 ACPI_CLEAR_BIT(enable_mask, register_bit);
127 break;
128
129 default:
130 ACPI_ERROR((AE_INFO, "Invalid action\n"));
131 return (AE_BAD_PARAMETER);
132 }
Bob Mooree38e8a02008-06-13 08:28:55 +0800133
134 /* Write the updated enable mask */
135
Bob Moorec6b57742009-06-24 09:44:06 +0800136 status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address);
Bob Mooree38e8a02008-06-13 08:28:55 +0800137 return (status);
138}
139
140/******************************************************************************
141 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700142 * FUNCTION: acpi_hw_write_gpe_enable_reg
143 *
144 * PARAMETERS: gpe_event_info - Info block for the GPE to be enabled
145 *
146 * RETURN: Status
147 *
148 * DESCRIPTION: Write a GPE enable register. Note: The bit for this GPE must
149 * already be cleared or set in the parent register
150 * enable_for_run mask.
151 *
152 ******************************************************************************/
153
154acpi_status
Bob Mooree38e8a02008-06-13 08:28:55 +0800155acpi_hw_write_gpe_enable_reg(struct acpi_gpe_event_info * gpe_event_info)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700156{
Len Brown4be44fc2005-08-05 00:44:28 -0400157 struct acpi_gpe_register_info *gpe_register_info;
158 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159
Len Brown4be44fc2005-08-05 00:44:28 -0400160 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700161
162 /* Get the info block for the entire GPE register */
163
164 gpe_register_info = gpe_event_info->register_info;
165 if (!gpe_register_info) {
166 return (AE_NOT_EXIST);
167 }
168
169 /* Write the entire GPE (runtime) enable register */
170
Bob Moorec6b57742009-06-24 09:44:06 +0800171 status = acpi_hw_write(gpe_register_info->enable_for_run,
172 &gpe_register_info->enable_address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173
174 return (status);
175}
176
Linus Torvalds1da177e2005-04-16 15:20:36 -0700177/******************************************************************************
178 *
179 * FUNCTION: acpi_hw_clear_gpe
180 *
181 * PARAMETERS: gpe_event_info - Info block for the GPE to be cleared
182 *
183 * RETURN: Status
184 *
185 * DESCRIPTION: Clear the status bit for a single GPE.
186 *
187 ******************************************************************************/
188
Len Brown4be44fc2005-08-05 00:44:28 -0400189acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700190{
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200191 struct acpi_gpe_register_info *gpe_register_info;
Len Brown4be44fc2005-08-05 00:44:28 -0400192 acpi_status status;
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200193 u32 register_bit;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700194
Len Brown4be44fc2005-08-05 00:44:28 -0400195 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700196
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200197 /* Get the info block for the entire GPE register */
198
199 gpe_register_info = gpe_event_info->register_info;
200 if (!gpe_register_info) {
201 return (AE_NOT_EXIST);
202 }
203
204 register_bit = acpi_hw_gpe_register_bit(gpe_event_info,
205 gpe_register_info);
Alexey Starikovskiy69874162007-02-02 19:48:19 +0300206
Linus Torvalds1da177e2005-04-16 15:20:36 -0700207 /*
208 * Write a one to the appropriate bit in the status register to
209 * clear this GPE.
210 */
Bob Moorec6b57742009-06-24 09:44:06 +0800211 status = acpi_hw_write(register_bit,
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200212 &gpe_register_info->status_address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700213
214 return (status);
215}
216
Linus Torvalds1da177e2005-04-16 15:20:36 -0700217/******************************************************************************
218 *
219 * FUNCTION: acpi_hw_get_gpe_status
220 *
221 * PARAMETERS: gpe_event_info - Info block for the GPE to queried
222 * event_status - Where the GPE status is returned
223 *
224 * RETURN: Status
225 *
226 * DESCRIPTION: Return the status of a single GPE.
227 *
228 ******************************************************************************/
Robert Moore44f6c012005-04-18 22:49:35 -0400229
Linus Torvalds1da177e2005-04-16 15:20:36 -0700230acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400231acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
232 acpi_event_status * event_status)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700233{
Len Brown4be44fc2005-08-05 00:44:28 -0400234 u32 in_byte;
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200235 u32 register_bit;
Len Brown4be44fc2005-08-05 00:44:28 -0400236 struct acpi_gpe_register_info *gpe_register_info;
237 acpi_status status;
238 acpi_event_status local_event_status = 0;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700239
Len Brown4be44fc2005-08-05 00:44:28 -0400240 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700241
242 if (!event_status) {
243 return (AE_BAD_PARAMETER);
244 }
245
246 /* Get the info block for the entire GPE register */
247
248 gpe_register_info = gpe_event_info->register_info;
249
250 /* Get the register bitmask for this GPE */
251
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200252 register_bit = acpi_hw_gpe_register_bit(gpe_event_info,
253 gpe_register_info);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700254
255 /* GPE currently enabled? (enabled for runtime?) */
256
257 if (register_bit & gpe_register_info->enable_for_run) {
258 local_event_status |= ACPI_EVENT_FLAG_ENABLED;
259 }
260
261 /* GPE enabled for wake? */
262
263 if (register_bit & gpe_register_info->enable_for_wake) {
264 local_event_status |= ACPI_EVENT_FLAG_WAKE_ENABLED;
265 }
266
267 /* GPE currently active (status bit == 1)? */
268
Bob Moorec6b57742009-06-24 09:44:06 +0800269 status = acpi_hw_read(&in_byte, &gpe_register_info->status_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400270 if (ACPI_FAILURE(status)) {
Bob Moore2147d3f2010-01-21 09:08:31 +0800271 return (status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700272 }
273
274 if (register_bit & in_byte) {
275 local_event_status |= ACPI_EVENT_FLAG_SET;
276 }
277
278 /* Set return value */
279
280 (*event_status) = local_event_status;
Bob Moore2147d3f2010-01-21 09:08:31 +0800281 return (AE_OK);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700282}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700283
284/******************************************************************************
285 *
286 * FUNCTION: acpi_hw_disable_gpe_block
287 *
288 * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
289 * gpe_block - Gpe Block info
290 *
291 * RETURN: Status
292 *
Robert Moore44f6c012005-04-18 22:49:35 -0400293 * DESCRIPTION: Disable all GPEs within a single GPE block
Linus Torvalds1da177e2005-04-16 15:20:36 -0700294 *
295 ******************************************************************************/
296
297acpi_status
Bob Mooree97d6bf2008-12-30 09:45:17 +0800298acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
299 struct acpi_gpe_block_info *gpe_block, void *context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700300{
Len Brown4be44fc2005-08-05 00:44:28 -0400301 u32 i;
302 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700303
304 /* Examine each GPE Register within the block */
305
306 for (i = 0; i < gpe_block->register_count; i++) {
Bob Moore52fc0b02006-10-02 00:00:00 -0400307
Linus Torvalds1da177e2005-04-16 15:20:36 -0700308 /* Disable all GPEs in this register */
309
Bob Mooreecfbbc72008-12-31 02:55:32 +0800310 status =
Bob Moorec6b57742009-06-24 09:44:06 +0800311 acpi_hw_write(0x00,
312 &gpe_block->register_info[i].enable_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400313 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700314 return (status);
315 }
316 }
317
318 return (AE_OK);
319}
320
Linus Torvalds1da177e2005-04-16 15:20:36 -0700321/******************************************************************************
322 *
323 * FUNCTION: acpi_hw_clear_gpe_block
324 *
325 * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
326 * gpe_block - Gpe Block info
327 *
328 * RETURN: Status
329 *
Robert Moore44f6c012005-04-18 22:49:35 -0400330 * DESCRIPTION: Clear status bits for all GPEs within a single GPE block
Linus Torvalds1da177e2005-04-16 15:20:36 -0700331 *
332 ******************************************************************************/
333
334acpi_status
Bob Mooree97d6bf2008-12-30 09:45:17 +0800335acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
336 struct acpi_gpe_block_info *gpe_block, void *context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337{
Len Brown4be44fc2005-08-05 00:44:28 -0400338 u32 i;
339 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700340
341 /* Examine each GPE Register within the block */
342
343 for (i = 0; i < gpe_block->register_count; i++) {
Bob Moore52fc0b02006-10-02 00:00:00 -0400344
Linus Torvalds1da177e2005-04-16 15:20:36 -0700345 /* Clear status on all GPEs in this register */
346
Bob Mooreecfbbc72008-12-31 02:55:32 +0800347 status =
Bob Moorec6b57742009-06-24 09:44:06 +0800348 acpi_hw_write(0xFF,
349 &gpe_block->register_info[i].status_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400350 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700351 return (status);
352 }
353 }
354
355 return (AE_OK);
356}
357
Linus Torvalds1da177e2005-04-16 15:20:36 -0700358/******************************************************************************
359 *
360 * FUNCTION: acpi_hw_enable_runtime_gpe_block
361 *
362 * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
363 * gpe_block - Gpe Block info
364 *
365 * RETURN: Status
366 *
Robert Moore44f6c012005-04-18 22:49:35 -0400367 * DESCRIPTION: Enable all "runtime" GPEs within a single GPE block. Includes
368 * combination wake/run GPEs.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700369 *
370 ******************************************************************************/
371
372acpi_status
Bob Mooree97d6bf2008-12-30 09:45:17 +0800373acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
374 struct acpi_gpe_block_info *gpe_block, void *context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700375{
Len Brown4be44fc2005-08-05 00:44:28 -0400376 u32 i;
377 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700378
379 /* NOTE: assumes that all GPEs are currently disabled */
380
381 /* Examine each GPE Register within the block */
382
383 for (i = 0; i < gpe_block->register_count; i++) {
384 if (!gpe_block->register_info[i].enable_for_run) {
385 continue;
386 }
387
388 /* Enable all "runtime" GPEs in this register */
389
Bob Moorec6b57742009-06-24 09:44:06 +0800390 status =
391 acpi_hw_write(gpe_block->register_info[i].enable_for_run,
392 &gpe_block->register_info[i].enable_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400393 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700394 return (status);
395 }
396 }
397
398 return (AE_OK);
399}
400
Linus Torvalds1da177e2005-04-16 15:20:36 -0700401/******************************************************************************
402 *
403 * FUNCTION: acpi_hw_enable_wakeup_gpe_block
404 *
405 * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
406 * gpe_block - Gpe Block info
407 *
408 * RETURN: Status
409 *
Robert Moore44f6c012005-04-18 22:49:35 -0400410 * DESCRIPTION: Enable all "wake" GPEs within a single GPE block. Includes
411 * combination wake/run GPEs.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700412 *
413 ******************************************************************************/
414
Robert Moore44f6c012005-04-18 22:49:35 -0400415static acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400416acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
Bob Mooree97d6bf2008-12-30 09:45:17 +0800417 struct acpi_gpe_block_info *gpe_block,
418 void *context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700419{
Len Brown4be44fc2005-08-05 00:44:28 -0400420 u32 i;
421 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700422
423 /* Examine each GPE Register within the block */
424
425 for (i = 0; i < gpe_block->register_count; i++) {
426 if (!gpe_block->register_info[i].enable_for_wake) {
427 continue;
428 }
429
430 /* Enable all "wake" GPEs in this register */
431
Bob Moorec6b57742009-06-24 09:44:06 +0800432 status =
433 acpi_hw_write(gpe_block->register_info[i].enable_for_wake,
434 &gpe_block->register_info[i].enable_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400435 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700436 return (status);
437 }
438 }
439
440 return (AE_OK);
441}
442
Linus Torvalds1da177e2005-04-16 15:20:36 -0700443/******************************************************************************
444 *
445 * FUNCTION: acpi_hw_disable_all_gpes
446 *
Robert Moore73459f72005-06-24 00:00:00 -0400447 * PARAMETERS: None
Linus Torvalds1da177e2005-04-16 15:20:36 -0700448 *
449 * RETURN: Status
450 *
Robert Moore44f6c012005-04-18 22:49:35 -0400451 * DESCRIPTION: Disable and clear all GPEs in all GPE blocks
Linus Torvalds1da177e2005-04-16 15:20:36 -0700452 *
453 ******************************************************************************/
454
Len Brown4be44fc2005-08-05 00:44:28 -0400455acpi_status acpi_hw_disable_all_gpes(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700456{
Len Brown4be44fc2005-08-05 00:44:28 -0400457 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700458
Bob Mooreb229cf92006-04-21 17:15:00 -0400459 ACPI_FUNCTION_TRACE(hw_disable_all_gpes);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700460
Bob Mooree97d6bf2008-12-30 09:45:17 +0800461 status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block, NULL);
462 status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block, NULL);
Len Brown4be44fc2005-08-05 00:44:28 -0400463 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700464}
465
Linus Torvalds1da177e2005-04-16 15:20:36 -0700466/******************************************************************************
467 *
468 * FUNCTION: acpi_hw_enable_all_runtime_gpes
469 *
Robert Moore73459f72005-06-24 00:00:00 -0400470 * PARAMETERS: None
Linus Torvalds1da177e2005-04-16 15:20:36 -0700471 *
472 * RETURN: Status
473 *
Robert Moore44f6c012005-04-18 22:49:35 -0400474 * DESCRIPTION: Enable all "runtime" GPEs, in all GPE blocks
Linus Torvalds1da177e2005-04-16 15:20:36 -0700475 *
476 ******************************************************************************/
477
Len Brown4be44fc2005-08-05 00:44:28 -0400478acpi_status acpi_hw_enable_all_runtime_gpes(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700479{
Len Brown4be44fc2005-08-05 00:44:28 -0400480 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700481
Bob Mooreb229cf92006-04-21 17:15:00 -0400482 ACPI_FUNCTION_TRACE(hw_enable_all_runtime_gpes);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700483
Bob Mooree97d6bf2008-12-30 09:45:17 +0800484 status = acpi_ev_walk_gpe_list(acpi_hw_enable_runtime_gpe_block, NULL);
Len Brown4be44fc2005-08-05 00:44:28 -0400485 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700486}
487
Linus Torvalds1da177e2005-04-16 15:20:36 -0700488/******************************************************************************
489 *
490 * FUNCTION: acpi_hw_enable_all_wakeup_gpes
491 *
Robert Moore73459f72005-06-24 00:00:00 -0400492 * PARAMETERS: None
Linus Torvalds1da177e2005-04-16 15:20:36 -0700493 *
494 * RETURN: Status
495 *
Robert Moore44f6c012005-04-18 22:49:35 -0400496 * DESCRIPTION: Enable all "wakeup" GPEs, in all GPE blocks
Linus Torvalds1da177e2005-04-16 15:20:36 -0700497 *
498 ******************************************************************************/
499
Len Brown4be44fc2005-08-05 00:44:28 -0400500acpi_status acpi_hw_enable_all_wakeup_gpes(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700501{
Len Brown4be44fc2005-08-05 00:44:28 -0400502 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700503
Bob Mooreb229cf92006-04-21 17:15:00 -0400504 ACPI_FUNCTION_TRACE(hw_enable_all_wakeup_gpes);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700505
Bob Mooree97d6bf2008-12-30 09:45:17 +0800506 status = acpi_ev_walk_gpe_list(acpi_hw_enable_wakeup_gpe_block, NULL);
Len Brown4be44fc2005-08-05 00:44:28 -0400507 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700508}