blob: 64560045052dd152d70e4b404af9a11d1b43b57e [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/******************************************************************************
2 *
3 * Module Name: hwgpe - Low level GPE enable/disable/clear functions
4 *
5 *****************************************************************************/
6
7/*
Bob Moore77848132012-01-12 13:27:23 +08008 * Copyright (C) 2000 - 2012, Intel Corp.
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 * 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#include <acpi/acpi.h>
Len Browne2f7a772009-01-09 00:30:03 -050045#include "accommon.h"
46#include "acevents.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070047
48#define _COMPONENT ACPI_HARDWARE
Len Brown4be44fc2005-08-05 00:44:28 -040049ACPI_MODULE_NAME("hwgpe")
Bob Moore33620c52012-02-14 18:14:27 +080050#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
Robert Moore44f6c012005-04-18 22:49:35 -040051/* Local prototypes */
Robert Moore44f6c012005-04-18 22:49:35 -040052static acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -040053acpi_hw_enable_wakeup_gpe_block(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
Bob Mooree97d6bf2008-12-30 09:45:17 +080054 struct acpi_gpe_block_info *gpe_block,
55 void *context);
Linus Torvalds1da177e2005-04-16 15:20:36 -070056
57/******************************************************************************
58 *
Lin Mingb76df672010-07-01 10:07:17 +080059 * FUNCTION: acpi_hw_get_gpe_register_bit
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020060 *
61 * PARAMETERS: gpe_event_info - Info block for the GPE
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020062 *
Lin Mingda503372010-12-13 13:39:37 +080063 * RETURN: Register mask with a one in the GPE bit position
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020064 *
Lin Mingda503372010-12-13 13:39:37 +080065 * DESCRIPTION: Compute the register mask for this GPE. One bit is set in the
66 * correct position for the input GPE.
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020067 *
68 ******************************************************************************/
69
Feng Tang1d94e1e2012-08-17 11:10:02 +080070u32 acpi_hw_get_gpe_register_bit(struct acpi_gpe_event_info *gpe_event_info)
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020071{
72 return (u32)1 << (gpe_event_info->gpe_number -
Feng Tang1d94e1e2012-08-17 11:10:02 +080073 gpe_event_info->register_info->base_gpe_number);
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020074}
75
76/******************************************************************************
77 *
Rafael J. Wysockifd247442010-06-08 10:49:08 +020078 * FUNCTION: acpi_hw_low_set_gpe
Bob Mooree38e8a02008-06-13 08:28:55 +080079 *
80 * PARAMETERS: gpe_event_info - Info block for the GPE to be disabled
Rafael J. Wysockifd247442010-06-08 10:49:08 +020081 * action - Enable or disable
Bob Mooree38e8a02008-06-13 08:28:55 +080082 *
83 * RETURN: Status
84 *
Lin Mingda503372010-12-13 13:39:37 +080085 * DESCRIPTION: Enable or disable a single GPE in the parent enable register.
Bob Mooree38e8a02008-06-13 08:28:55 +080086 *
87 ******************************************************************************/
88
Rafael J. Wysockifd247442010-06-08 10:49:08 +020089acpi_status
Lin Mingda503372010-12-13 13:39:37 +080090acpi_hw_low_set_gpe(struct acpi_gpe_event_info *gpe_event_info, u32 action)
Bob Mooree38e8a02008-06-13 08:28:55 +080091{
92 struct acpi_gpe_register_info *gpe_register_info;
93 acpi_status status;
94 u32 enable_mask;
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +020095 u32 register_bit;
Bob Mooree38e8a02008-06-13 08:28:55 +080096
Rafael J. Wysockifd247442010-06-08 10:49:08 +020097 ACPI_FUNCTION_ENTRY();
98
Bob Mooree38e8a02008-06-13 08:28:55 +080099 /* Get the info block for the entire GPE register */
100
101 gpe_register_info = gpe_event_info->register_info;
102 if (!gpe_register_info) {
103 return (AE_NOT_EXIST);
104 }
105
106 /* Get current value of the enable register that contains this GPE */
107
Bob Moorec6b57742009-06-24 09:44:06 +0800108 status = acpi_hw_read(&enable_mask, &gpe_register_info->enable_address);
Bob Mooree38e8a02008-06-13 08:28:55 +0800109 if (ACPI_FAILURE(status)) {
110 return (status);
111 }
112
Lin Mingda503372010-12-13 13:39:37 +0800113 /* Set or clear just the bit that corresponds to this GPE */
Bob Mooree38e8a02008-06-13 08:28:55 +0800114
Feng Tang1d94e1e2012-08-17 11:10:02 +0800115 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info);
Rafael J. Wysockifd247442010-06-08 10:49:08 +0200116 switch (action) {
Lin Ming3a378982010-12-13 13:36:15 +0800117 case ACPI_GPE_CONDITIONAL_ENABLE:
Lin Mingda503372010-12-13 13:39:37 +0800118
119 /* Only enable if the enable_for_run bit is set */
120
121 if (!(register_bit & gpe_register_info->enable_for_run)) {
Rafael J. Wysockic9a8bbb2010-06-08 10:49:45 +0200122 return (AE_BAD_PARAMETER);
Lin Mingda503372010-12-13 13:39:37 +0800123 }
124
125 /*lint -fallthrough */
Rafael J. Wysockic9a8bbb2010-06-08 10:49:45 +0200126
Rafael J. Wysockifd247442010-06-08 10:49:08 +0200127 case ACPI_GPE_ENABLE:
128 ACPI_SET_BIT(enable_mask, register_bit);
129 break;
130
131 case ACPI_GPE_DISABLE:
132 ACPI_CLEAR_BIT(enable_mask, register_bit);
133 break;
134
135 default:
Lin Mingda503372010-12-13 13:39:37 +0800136 ACPI_ERROR((AE_INFO, "Invalid GPE Action, %u\n", action));
Rafael J. Wysockifd247442010-06-08 10:49:08 +0200137 return (AE_BAD_PARAMETER);
138 }
Bob Mooree38e8a02008-06-13 08:28:55 +0800139
140 /* Write the updated enable mask */
141
Bob Moorec6b57742009-06-24 09:44:06 +0800142 status = acpi_hw_write(enable_mask, &gpe_register_info->enable_address);
Bob Mooree38e8a02008-06-13 08:28:55 +0800143 return (status);
144}
145
146/******************************************************************************
147 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148 * FUNCTION: acpi_hw_clear_gpe
149 *
150 * PARAMETERS: gpe_event_info - Info block for the GPE to be cleared
151 *
152 * RETURN: Status
153 *
154 * DESCRIPTION: Clear the status bit for a single GPE.
155 *
156 ******************************************************************************/
157
Len Brown4be44fc2005-08-05 00:44:28 -0400158acpi_status acpi_hw_clear_gpe(struct acpi_gpe_event_info * gpe_event_info)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159{
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200160 struct acpi_gpe_register_info *gpe_register_info;
Len Brown4be44fc2005-08-05 00:44:28 -0400161 acpi_status status;
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200162 u32 register_bit;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700163
Len Brown4be44fc2005-08-05 00:44:28 -0400164 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700165
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200166 /* Get the info block for the entire GPE register */
167
168 gpe_register_info = gpe_event_info->register_info;
169 if (!gpe_register_info) {
170 return (AE_NOT_EXIST);
171 }
172
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173 /*
174 * Write a one to the appropriate bit in the status register to
175 * clear this GPE.
176 */
Feng Tang1d94e1e2012-08-17 11:10:02 +0800177 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_info);
Lin Mingda503372010-12-13 13:39:37 +0800178
Bob Moorec6b57742009-06-24 09:44:06 +0800179 status = acpi_hw_write(register_bit,
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200180 &gpe_register_info->status_address);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181
182 return (status);
183}
184
Linus Torvalds1da177e2005-04-16 15:20:36 -0700185/******************************************************************************
186 *
187 * FUNCTION: acpi_hw_get_gpe_status
188 *
189 * PARAMETERS: gpe_event_info - Info block for the GPE to queried
190 * event_status - Where the GPE status is returned
191 *
192 * RETURN: Status
193 *
194 * DESCRIPTION: Return the status of a single GPE.
195 *
196 ******************************************************************************/
Robert Moore44f6c012005-04-18 22:49:35 -0400197
Linus Torvalds1da177e2005-04-16 15:20:36 -0700198acpi_status
Len Brown4be44fc2005-08-05 00:44:28 -0400199acpi_hw_get_gpe_status(struct acpi_gpe_event_info * gpe_event_info,
200 acpi_event_status * event_status)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700201{
Len Brown4be44fc2005-08-05 00:44:28 -0400202 u32 in_byte;
Rafael J. Wysockie4e9a732010-06-08 10:48:26 +0200203 u32 register_bit;
Len Brown4be44fc2005-08-05 00:44:28 -0400204 struct acpi_gpe_register_info *gpe_register_info;
Len Brown4be44fc2005-08-05 00:44:28 -0400205 acpi_event_status local_event_status = 0;
Lin Mingda503372010-12-13 13:39:37 +0800206 acpi_status status;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700207
Len Brown4be44fc2005-08-05 00:44:28 -0400208 ACPI_FUNCTION_ENTRY();
Linus Torvalds1da177e2005-04-16 15:20:36 -0700209
210 if (!event_status) {
211 return (AE_BAD_PARAMETER);
212 }
213
214 /* Get the info block for the entire GPE register */
215
216 gpe_register_info = gpe_event_info->register_info;
217
218 /* Get the register bitmask for this GPE */
219
Feng Tang1d94e1e2012-08-17 11:10:02 +0800220 register_bit = acpi_hw_get_gpe_register_bit(gpe_event_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,
Lv Zheng1f86e8c2012-10-31 02:25:45 +0000341 struct acpi_gpe_block_info * gpe_block,
342 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 */