aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/acpi/acpica/evxfgpe.c47
-rw-r--r--include/acpi/acpixf.h4
2 files changed, 51 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/evxfgpe.c b/drivers/acpi/acpica/evxfgpe.c
index 82e5c146bdd4..0cf159cc6e6d 100644
--- a/drivers/acpi/acpica/evxfgpe.c
+++ b/drivers/acpi/acpica/evxfgpe.c
@@ -187,6 +187,53 @@ ACPI_EXPORT_SYMBOL(acpi_disable_gpe)
187 187
188/******************************************************************************* 188/*******************************************************************************
189 * 189 *
190 * FUNCTION: acpi_mark_gpe_for_wake
191 *
192 * PARAMETERS: gpe_device - Parent GPE Device. NULL for GPE0/GPE1
193 * gpe_number - GPE level within the GPE block
194 *
195 * RETURN: Status
196 *
197 * DESCRIPTION: Mark a GPE as having the ability to wake the system. Simply
198 * sets the ACPI_GPE_CAN_WAKE flag.
199 *
200 * Some potential callers of acpi_setup_gpe_for_wake may know in advance that
201 * there won't be any notify handlers installed for device wake notifications
202 * from the given GPE (one example is a button GPE in Linux). For these cases,
203 * acpi_mark_gpe_for_wake should be used instead of acpi_setup_gpe_for_wake.
204 * This will set the ACPI_GPE_CAN_WAKE flag for the GPE without trying to
205 * setup implicit wake notification for it (since there's no handler method).
206 *
207 ******************************************************************************/
208acpi_status acpi_mark_gpe_for_wake(acpi_handle gpe_device, u32 gpe_number)
209{
210 struct acpi_gpe_event_info *gpe_event_info;
211 acpi_status status = AE_BAD_PARAMETER;
212 acpi_cpu_flags flags;
213
214 ACPI_FUNCTION_TRACE(acpi_mark_gpe_for_wake);
215
216 flags = acpi_os_acquire_lock(acpi_gbl_gpe_lock);
217
218 /* Ensure that we have a valid GPE number */
219
220 gpe_event_info = acpi_ev_get_gpe_event_info(gpe_device, gpe_number);
221 if (gpe_event_info) {
222
223 /* Mark the GPE as a possible wake event */
224
225 gpe_event_info->flags |= ACPI_GPE_CAN_WAKE;
226 status = AE_OK;
227 }
228
229 acpi_os_release_lock(acpi_gbl_gpe_lock, flags);
230 return_ACPI_STATUS(status);
231}
232
233ACPI_EXPORT_SYMBOL(acpi_mark_gpe_for_wake)
234
235/*******************************************************************************
236 *
190 * FUNCTION: acpi_setup_gpe_for_wake 237 * FUNCTION: acpi_setup_gpe_for_wake
191 * 238 *
192 * PARAMETERS: wake_device - Device associated with the GPE (via _PRW) 239 * PARAMETERS: wake_device - Device associated with the GPE (via _PRW)
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 3f6e14ff24b1..508e5649dda9 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -675,6 +675,10 @@ ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
675 u32 gpe_number)) 675 u32 gpe_number))
676 676
677ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status 677ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
678 acpi_mark_gpe_for_wake(acpi_handle gpe_device,
679 u32 gpe_number))
680
681ACPI_HW_DEPENDENT_RETURN_STATUS(acpi_status
678 acpi_setup_gpe_for_wake(acpi_handle 682 acpi_setup_gpe_for_wake(acpi_handle
679 parent_device, 683 parent_device,
680 acpi_handle gpe_device, 684 acpi_handle gpe_device,