aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/evxfevnt.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/evxfevnt.c')
-rw-r--r--drivers/acpi/acpica/evxfevnt.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/evxfevnt.c b/drivers/acpi/acpica/evxfevnt.c
index d97b8dce1668..d6a6d4a76592 100644
--- a/drivers/acpi/acpica/evxfevnt.c
+++ b/drivers/acpi/acpica/evxfevnt.c
@@ -308,6 +308,73 @@ ACPI_EXPORT_SYMBOL(acpi_set_gpe)
308 308
309/******************************************************************************* 309/*******************************************************************************
310 * 310 *
311 * FUNCTION: acpi_gpe_wakeup
312 *
313 * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1
314 * gpe_number - GPE level within the GPE block
315 * Action - Enable or Disable
316 *
317 * RETURN: Status
318 *
319 * DESCRIPTION: Set or clear the GPE's wakeup enable mask bit.
320 *
321 ******************************************************************************/
322acpi_status acpi_gpe_wakeup(acpi_handle gpe_device, u32 gpe_number, u8 action)
323{
324 acpi_status status = AE_OK;
325 struct acpi_gpe_event_info *gpe_event_info;
326 struct acpi_gpe_register_info *gpe_register_info;
327 acpi_cpu_flags flags;
328 u32 register_bit;
329
330 ACPI_FUNCTION_TRACE(acpi_gpe_wakeup);
331
332 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
333
334 /* Ensure that we have a valid GPE number */
335
336 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
337 if (!gpe_event_info) {
338 status = AE_BAD_PARAMETER;
339 goto unlock_and_exit;
340 }
341
342 gpe_register_info = gpe_event_info->register_info;
343 if (!gpe_register_info) {
344 status = AE_NOT_EXIST;
345 goto unlock_and_exit;
346 }
347
348 register_bit =
349 acpi_hw_get_gpe_register_bit(gpe_event_info, gpe_register_info);
350
351 /* Perform the action */
352
353 switch (action) {
354 case ACPI_GPE_ENABLE:
355 ACPI_SET_BIT(gpe_register_info->enable_for_wake, register_bit);
356 break;
357
358 case ACPI_GPE_DISABLE:
359 ACPI_CLEAR_BIT(gpe_register_info->enable_for_wake,
360 register_bit);
361 break;
362
363 default:
364 ACPI_ERROR((AE_INFO, "%u, Invalid action", action));
365 status = AE_BAD_PARAMETER;
366 break;
367 }
368
369unlock_and_exit:
370 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
371 return_ACPI_STATUS(status);
372}
373
374ACPI_EXPORT_SYMBOL(acpi_gpe_wakeup)
375
376/*******************************************************************************
377 *
311 * FUNCTION: acpi_enable_gpe 378 * FUNCTION: acpi_enable_gpe
312 * 379 *
313 * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1 380 * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1