blob: db4076580e2b38d5fd22c7178b1663de5c0d379b [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 Moore77848132012-01-12 13:27:23 +08009 * Copyright (C) 2000 - 2012, 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")
Bob Moore33620c52012-02-14 18:14:27 +080051#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
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
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020063 *
Lin Mingda503372010-12-13 13:39:37 +080064 * RETURN: Register mask with a one in the GPE bit position
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020065 *
Lin Mingda503372010-12-13 13:39:37 +080066 * DESCRIPTION: Compute the register mask for this GPE. One bit is set in the
67 * correct position for the input GPE.
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020068 *
69 ******************************************************************************/
70
Feng Tang1d94e1e2012-08-17 11:10:02 +080071u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info)
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020072{
73 return (u32)1 << (gpe_event_info->gpe_number -
Feng Tang1d94e1e2012-08-17 11:10:02 +080074 gpe_event_info->register_info->base_gpe_number);
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020075}
76
77/******************************************************************************
78 *
Rafael J. Wysockifd247442010-06-08 10:49:08 +020079 * FUNCTION: acpi_hw_low_set_gpe
Bob Mooree38e8a02008-06-13 08:28:55 +080080 *
81 * PARAMETERS: gpe_event_info - Info block for the GPE to be disabled
Rafael J. Wysockifd247442010-06-08 10:49:08 +020082 * action - Enable or disable
Bob Mooree38e8a02008-06-13 08:28:55 +080083 *
84 * RETURN: Status
85 *
Lin Mingda503372010-12-13 13:39:37 +080086 * DESCRIPTION: Enable or disable a single GPE in the parent enable register.
Bob Mooree38e8a02008-06-13 08:28:55 +080087 *
88 ******************************************************************************/
89
Rafael J. Wysockifd247442010-06-08 10:49:08 +020090acpi_status
Lin Mingda503372010-12-13 13:39:37 +080091acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action)
Bob Mooree38e8a02008-06-13 08:28:55 +080092{
93 struct acpi_gpe_register_info *gpe_register_info;
94 acpi_status status;
95 u32 enable_mask;
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020096 u32 register_bit;
Bob Mooree38e8a02008-06-13 08:28:55 +080097
Rafael J. Wysockifd247442010-06-08 10:49:08 +020098 ACPI_FUNCTION_ENTRY();
99
Bob Mooree38e8a02008-06-13 08:28:55 +0800100 /* Get the info block for the entire GPE register */
101
102 gpe_register_info = gpe_event_info->register_info;
103 if (!gpe_register_info) {
104 return (AE_NOT_EXIST);
105 }
106
107 /* Get current value of the enable register that contains this GPE */
108
Bob Moorec6b57742009-06-24 09:44:06 +0800109 status = acpi_hw_read(&enable_mask, &gpe_register_info->enable_address);
Bob Mooree38e8a02008-06-13 08:28:55 +0800110 if (ACPI_FAILURE(status)) {
111 return (status);
112 }
113
Lin Mingda503372010-12-13 13:39:37 +0800114 /* Set or clear just the bit that corresponds to this GPE */
Bob Mooree38e8a02008-06-13 08:28:55 +0800115
Feng Tang1d94e1e2012-08-17 11:10:02 +0800116 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info);
Rafael J. Wysockifd247442010-06-08 10:49:08 +0200117 switch (action) {
Lin Ming3a378982010-12-13 13:36:15 +0800118 case ACPI_GPE_CONDITIONAL_ENABLE:
Lin Mingda503372010-12-13 13:39:37 +0800119
120 /* Only enable if the enable_for_run bit is set */
121
122 if (!(register_bit & gpe_register_info->enable_for_run)) {
Rafael J. Wysockic9a8bbb2010-06-08 10:49:45 +0200123 return (AE_BAD_PARAMETER);
Lin Mingda503372010-12-13 13:39:37 +0800124 }
125
126 /*lint -fallthrough */
Rafael J. Wysockic9a8bbb2010-06-08 10:49:45 +0200127
Rafael J. Wysockifd247442010-06-08 10:49:08 +0200128 case ACPI_GPE_ENABLE:
129 ACPI_SET_BIT(enable_mask, register_bit);
130 break;
131
132 case ACPI_GPE_DISABLE:
133 ACPI_CLEAR_BIT(enable_mask, register_bit);
134 break;
135
136 default:
Lin Mingda503372010-12-13 13:39:37 +0800137 ACPI_ERROR((AE_INFO, "Invalid GPE Action, %u\n", action));
Rafael J. Wysockifd247442010-06-08 10:49:08 +0200138 return (AE_BAD_PARAMETER);
139 }
Bob Mooree38e8a02008-06-13 08:28:55 +0800140
141 /* Write the updated enable mask */
142
Bob Moorec6b57742009-06-24 09:44:06 +0800143 status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address);
Bob Mooree38e8a02008-06-13 08:28:55 +0800144 return (status);
145}
146
147/******************************************************************************
148 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700149 * FUNCTION: acpi_hw_clear_gpe
150 *
151 * PARAMETERS: gpe_event_info - Info block for the GPE to be cleared
152 *
153 * RETURN: Status
154 *
155 * DESCRIPTION: Clear the status bit for a single GPE.
156 *
157 ******************************************************************************/
158
Len Brown4be44fc2005-08-05 00:44:28 -0400159acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700160{
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200161 struct acpi_gpe_register_info *gpe_register_info;
Len Brown4be44fc2005-08-05 00:44:28 -0400162 acpi_status status;
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200163 u32 register_bit;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700164
Len Brown4be44fc2005-08-05 00:44:28 -0400165 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700166
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200167 /* Get the info block for the entire GPE register */
168
169 gpe_register_info = gpe_event_info->register_info;
170 if (!gpe_register_info) {
171 return (AE_NOT_EXIST);
172 }
173
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 */
Feng Tang1d94e1e2012-08-17 11:10:02 +0800178 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info);
Lin Mingda503372010-12-13 13:39:37 +0800179
Bob Moorec6b57742009-06-24 09:44:06 +0800180 status = acpi_hw_write(register_bit,
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200181 &gpe_register_info->status_address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700182
183 return (status);
184}
185
Linus Torvalds1da177e2005-04-16 15:20:36 -0700186/******************************************************************************
187 *
188 * FUNCTION: acpi_hw_get_gpe_status
189 *
190 * PARAMETERS: gpe_event_info - Info block for the GPE to queried
191 * event_status - Where the GPE status is returned
192 *
193 * RETURN: Status
194 *
195 * DESCRIPTION: Return the status of a single GPE.
196 *
197 ******************************************************************************/
Robert Moore44f6c012005-04-18 22:49:35 -0400198
Linus Torvalds1da177e2005-04-16 15:20:36 -0700199acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400200acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
201 acpi_event_status * event_status)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700202{
Len Brown4be44fc2005-08-05 00:44:28 -0400203 u32 in_byte;
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200204 u32 register_bit;
Len Brown4be44fc2005-08-05 00:44:28 -0400205 struct acpi_gpe_register_info *gpe_register_info;
Len Brown4be44fc2005-08-05 00:44:28 -0400206 acpi_event_status local_event_status = 0;
Lin Mingda503372010-12-13 13:39:37 +0800207 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208
Len Brown4be44fc2005-08-05 00:44:28 -0400209 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700210
211 if (!event_status) {
212 return (AE_BAD_PARAMETER);
213 }
214
215 /* Get the info block for the entire GPE register */
216
217 gpe_register_info = gpe_event_info->register_info;
218
219 /* Get the register bitmask for this GPE */
220
Feng Tang1d94e1e2012-08-17 11:10:02 +0800221 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700222
223 /* GPE currently enabled? (enabled for runtime?) */
224
225 if (register_bit & gpe_register_info->enable_for_run) {
226 local_event_status |= ACPI_EVENT_FLAG_ENABLED;
227 }
228
229 /* GPE enabled for wake? */
230
231 if (register_bit & gpe_register_info->enable_for_wake) {
232 local_event_status |= ACPI_EVENT_FLAG_WAKE_ENABLED;
233 }
234
235 /* GPE currently active (status bit == 1)? */
236
Bob Moorec6b57742009-06-24 09:44:06 +0800237 status = acpi_hw_read(&in_byte, &gpe_register_info->status_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400238 if (ACPI_FAILURE(status)) {
Bob Moore2147d3f2010-01-21 09:08:31 +0800239 return (status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700240 }
241
242 if (register_bit & in_byte) {
243 local_event_status |= ACPI_EVENT_FLAG_SET;
244 }
245
246 /* Set return value */
247
248 (*event_status) = local_event_status;
Bob Moore2147d3f2010-01-21 09:08:31 +0800249 return (AE_OK);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700250}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700251
252/******************************************************************************
253 *
254 * FUNCTION: acpi_hw_disable_gpe_block
255 *
256 * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
257 * gpe_block - Gpe Block info
258 *
259 * RETURN: Status
260 *
Robert Moore44f6c012005-04-18 22:49:35 -0400261 * DESCRIPTION: Disable all GPEs within a single GPE block
Linus Torvalds1da177e2005-04-16 15:20:36 -0700262 *
263 ******************************************************************************/
264
265acpi_status
Bob Mooree97d6bf2008-12-30 09:45:17 +0800266acpi_hw_disable_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
267 struct acpi_gpe_block_info *gpe_block, void *context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700268{
Len Brown4be44fc2005-08-05 00:44:28 -0400269 u32 i;
270 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700271
272 /* Examine each GPE Register within the block */
273
274 for (i = 0; i < gpe_block->register_count; i++) {
Bob Moore52fc0b02006-10-02 00:00:00 -0400275
Linus Torvalds1da177e2005-04-16 15:20:36 -0700276 /* Disable all GPEs in this register */
277
Bob Mooreecfbbc72008-12-31 02:55:32 +0800278 status =
Bob Moorec6b57742009-06-24 09:44:06 +0800279 acpi_hw_write(0x00,
280 &gpe_block->register_info[i].enable_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400281 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700282 return (status);
283 }
284 }
285
286 return (AE_OK);
287}
288
Linus Torvalds1da177e2005-04-16 15:20:36 -0700289/******************************************************************************
290 *
291 * FUNCTION: acpi_hw_clear_gpe_block
292 *
293 * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
294 * gpe_block - Gpe Block info
295 *
296 * RETURN: Status
297 *
Robert Moore44f6c012005-04-18 22:49:35 -0400298 * DESCRIPTION: Clear status bits for all GPEs within a single GPE block
Linus Torvalds1da177e2005-04-16 15:20:36 -0700299 *
300 ******************************************************************************/
301
302acpi_status
Bob Mooree97d6bf2008-12-30 09:45:17 +0800303acpi_hw_clear_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
304 struct acpi_gpe_block_info *gpe_block, void *context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700305{
Len Brown4be44fc2005-08-05 00:44:28 -0400306 u32 i;
307 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700308
309 /* Examine each GPE Register within the block */
310
311 for (i = 0; i < gpe_block->register_count; i++) {
Bob Moore52fc0b02006-10-02 00:00:00 -0400312
Linus Torvalds1da177e2005-04-16 15:20:36 -0700313 /* Clear status on all GPEs in this register */
314
Bob Mooreecfbbc72008-12-31 02:55:32 +0800315 status =
Bob Moorec6b57742009-06-24 09:44:06 +0800316 acpi_hw_write(0xFF,
317 &gpe_block->register_info[i].status_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400318 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700319 return (status);
320 }
321 }
322
323 return (AE_OK);
324}
325
Linus Torvalds1da177e2005-04-16 15:20:36 -0700326/******************************************************************************
327 *
328 * FUNCTION: acpi_hw_enable_runtime_gpe_block
329 *
330 * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
331 * gpe_block - Gpe Block info
332 *
333 * RETURN: Status
334 *
Robert Moore44f6c012005-04-18 22:49:35 -0400335 * DESCRIPTION: Enable all "runtime" GPEs within a single GPE block. Includes
336 * combination wake/run GPEs.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700337 *
338 ******************************************************************************/
339
340acpi_status
Bob Mooree97d6bf2008-12-30 09:45:17 +0800341acpi_hw_enable_runtime_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
342 struct acpi_gpe_block_info *gpe_block, void *context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700343{
Len Brown4be44fc2005-08-05 00:44:28 -0400344 u32 i;
345 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700346
347 /* NOTE: assumes that all GPEs are currently disabled */
348
349 /* Examine each GPE Register within the block */
350
351 for (i = 0; i < gpe_block->register_count; i++) {
352 if (!gpe_block->register_info[i].enable_for_run) {
353 continue;
354 }
355
356 /* Enable all "runtime" GPEs in this register */
357
Bob Moorec6b57742009-06-24 09:44:06 +0800358 status =
359 acpi_hw_write(gpe_block->register_info[i].enable_for_run,
360 &gpe_block->register_info[i].enable_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400361 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700362 return (status);
363 }
364 }
365
366 return (AE_OK);
367}
368
Linus Torvalds1da177e2005-04-16 15:20:36 -0700369/******************************************************************************
370 *
371 * FUNCTION: acpi_hw_enable_wakeup_gpe_block
372 *
373 * PARAMETERS: gpe_xrupt_info - GPE Interrupt info
374 * gpe_block - Gpe Block info
375 *
376 * RETURN: Status
377 *
Robert Moore44f6c012005-04-18 22:49:35 -0400378 * DESCRIPTION: Enable all "wake" GPEs within a single GPE block. Includes
379 * combination wake/run GPEs.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700380 *
381 ******************************************************************************/
382
Robert Moore44f6c012005-04-18 22:49:35 -0400383static acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400384acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
Bob Mooree97d6bf2008-12-30 09:45:17 +0800385 struct acpi_gpe_block_info *gpe_block,
386 void *context)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700387{
Len Brown4be44fc2005-08-05 00:44:28 -0400388 u32 i;
389 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700390
391 /* Examine each GPE Register within the block */
392
393 for (i = 0; i < gpe_block->register_count; i++) {
394 if (!gpe_block->register_info[i].enable_for_wake) {
395 continue;
396 }
397
398 /* Enable all "wake" GPEs in this register */
399
Bob Moorec6b57742009-06-24 09:44:06 +0800400 status =
401 acpi_hw_write(gpe_block->register_info[i].enable_for_wake,
402 &gpe_block->register_info[i].enable_address);
Len Brown4be44fc2005-08-05 00:44:28 -0400403 if (ACPI_FAILURE(status)) {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700404 return (status);
405 }
406 }
407
408 return (AE_OK);
409}
410
Linus Torvalds1da177e2005-04-16 15:20:36 -0700411/******************************************************************************
412 *
413 * FUNCTION: acpi_hw_disable_all_gpes
414 *
Robert Moore73459f72005-06-24 00:00:00 -0400415 * PARAMETERS: None
Linus Torvalds1da177e2005-04-16 15:20:36 -0700416 *
417 * RETURN: Status
418 *
Robert Moore44f6c012005-04-18 22:49:35 -0400419 * DESCRIPTION: Disable and clear all GPEs in all GPE blocks
Linus Torvalds1da177e2005-04-16 15:20:36 -0700420 *
421 ******************************************************************************/
422
Len Brown4be44fc2005-08-05 00:44:28 -0400423acpi_status acpi_hw_disable_all_gpes(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700424{
Len Brown4be44fc2005-08-05 00:44:28 -0400425 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700426
Bob Mooreb229cf92006-04-21 17:15:00 -0400427 ACPI_FUNCTION_TRACE(hw_disable_all_gpes);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700428
Bob Mooree97d6bf2008-12-30 09:45:17 +0800429 status = acpi_ev_walk_gpe_list(acpi_hw_disable_gpe_block, NULL);
430 status = acpi_ev_walk_gpe_list(acpi_hw_clear_gpe_block, NULL);
Len Brown4be44fc2005-08-05 00:44:28 -0400431 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700432}
433
Linus Torvalds1da177e2005-04-16 15:20:36 -0700434/******************************************************************************
435 *
436 * FUNCTION: acpi_hw_enable_all_runtime_gpes
437 *
Robert Moore73459f72005-06-24 00:00:00 -0400438 * PARAMETERS: None
Linus Torvalds1da177e2005-04-16 15:20:36 -0700439 *
440 * RETURN: Status
441 *
Robert Moore44f6c012005-04-18 22:49:35 -0400442 * DESCRIPTION: Enable all "runtime" GPEs, in all GPE blocks
Linus Torvalds1da177e2005-04-16 15:20:36 -0700443 *
444 ******************************************************************************/
445
Len Brown4be44fc2005-08-05 00:44:28 -0400446acpi_status acpi_hw_enable_all_runtime_gpes(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700447{
Len Brown4be44fc2005-08-05 00:44:28 -0400448 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700449
Bob Mooreb229cf92006-04-21 17:15:00 -0400450 ACPI_FUNCTION_TRACE(hw_enable_all_runtime_gpes);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700451
Bob Mooree97d6bf2008-12-30 09:45:17 +0800452 status = acpi_ev_walk_gpe_list(acpi_hw_enable_runtime_gpe_block, NULL);
Len Brown4be44fc2005-08-05 00:44:28 -0400453 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700454}
455
Linus Torvalds1da177e2005-04-16 15:20:36 -0700456/******************************************************************************
457 *
458 * FUNCTION: acpi_hw_enable_all_wakeup_gpes
459 *
Robert Moore73459f72005-06-24 00:00:00 -0400460 * PARAMETERS: None
Linus Torvalds1da177e2005-04-16 15:20:36 -0700461 *
462 * RETURN: Status
463 *
Robert Moore44f6c012005-04-18 22:49:35 -0400464 * DESCRIPTION: Enable all "wakeup" GPEs, in all GPE blocks
Linus Torvalds1da177e2005-04-16 15:20:36 -0700465 *
466 ******************************************************************************/
467
Len Brown4be44fc2005-08-05 00:44:28 -0400468acpi_status acpi_hw_enable_all_wakeup_gpes(void)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700469{
Len Brown4be44fc2005-08-05 00:44:28 -0400470 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700471
Bob Mooreb229cf92006-04-21 17:15:00 -0400472 ACPI_FUNCTION_TRACE(hw_enable_all_wakeup_gpes);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700473
Bob Mooree97d6bf2008-12-30 09:45:17 +0800474 status = acpi_ev_walk_gpe_list(acpi_hw_enable_wakeup_gpe_block, NULL);
Len Brown4be44fc2005-08-05 00:44:28 -0400475 return_ACPI_STATUS(status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700476}
Bob Moore33620c52012-02-14 18:14:27 +0800477
478#endif /* !ACPI_REDUCED_HARDWARE */