diff options
author | Bob Moore <robert.moore@intel.com> | 2011-11-16 01:46:57 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2012-01-17 03:36:30 -0500 |
commit | a91cdde20a870bd773d605c764ed211539bf3020 (patch) | |
tree | 92359c9a52d73d7c546cb4ea7414031e583f97c3 /drivers/acpi/acpica | |
parent | e0fe0a8d4ed5474261d0ee1452f5d9ae77236958 (diff) |
ACPI 5.0: New interface, acpi_get_event_resources
Executes _AEI and formats the result, similar to acpi_get_current_resources, etc.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/acpica')
-rw-r--r-- | drivers/acpi/acpica/acresrc.h | 4 | ||||
-rw-r--r-- | drivers/acpi/acpica/rsutils.c | 50 | ||||
-rw-r--r-- | drivers/acpi/acpica/rsxface.c | 40 |
3 files changed, 94 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/acresrc.h b/drivers/acpi/acpica/acresrc.h index 05721b023f88..61b2e049d8d6 100644 --- a/drivers/acpi/acpica/acresrc.h +++ b/drivers/acpi/acpica/acresrc.h | |||
@@ -215,6 +215,10 @@ acpi_status | |||
215 | acpi_rs_set_srs_method_data(struct acpi_namespace_node *node, | 215 | acpi_rs_set_srs_method_data(struct acpi_namespace_node *node, |
216 | struct acpi_buffer *ret_buffer); | 216 | struct acpi_buffer *ret_buffer); |
217 | 217 | ||
218 | acpi_status | ||
219 | acpi_rs_get_aei_method_data(struct acpi_namespace_node *node, | ||
220 | struct acpi_buffer *ret_buffer); | ||
221 | |||
218 | /* | 222 | /* |
219 | * rscalc | 223 | * rscalc |
220 | */ | 224 | */ |
diff --git a/drivers/acpi/acpica/rsutils.c b/drivers/acpi/acpica/rsutils.c index 4409db8209d7..54a9a974b624 100644 --- a/drivers/acpi/acpica/rsutils.c +++ b/drivers/acpi/acpica/rsutils.c | |||
@@ -594,6 +594,56 @@ acpi_rs_get_prs_method_data(struct acpi_namespace_node *node, | |||
594 | 594 | ||
595 | /******************************************************************************* | 595 | /******************************************************************************* |
596 | * | 596 | * |
597 | * FUNCTION: acpi_rs_get_aei_method_data | ||
598 | * | ||
599 | * PARAMETERS: Node - Device node | ||
600 | * ret_buffer - Pointer to a buffer structure for the | ||
601 | * results | ||
602 | * | ||
603 | * RETURN: Status | ||
604 | * | ||
605 | * DESCRIPTION: This function is called to get the _AEI value of an object | ||
606 | * contained in an object specified by the handle passed in | ||
607 | * | ||
608 | * If the function fails an appropriate status will be returned | ||
609 | * and the contents of the callers buffer is undefined. | ||
610 | * | ||
611 | ******************************************************************************/ | ||
612 | |||
613 | acpi_status | ||
614 | acpi_rs_get_aei_method_data(struct acpi_namespace_node *node, | ||
615 | struct acpi_buffer *ret_buffer) | ||
616 | { | ||
617 | union acpi_operand_object *obj_desc; | ||
618 | acpi_status status; | ||
619 | |||
620 | ACPI_FUNCTION_TRACE(rs_get_aei_method_data); | ||
621 | |||
622 | /* Parameters guaranteed valid by caller */ | ||
623 | |||
624 | /* Execute the method, no parameters */ | ||
625 | |||
626 | status = acpi_ut_evaluate_object(node, METHOD_NAME__AEI, | ||
627 | ACPI_BTYPE_BUFFER, &obj_desc); | ||
628 | if (ACPI_FAILURE(status)) { | ||
629 | return_ACPI_STATUS(status); | ||
630 | } | ||
631 | |||
632 | /* | ||
633 | * Make the call to create a resource linked list from the | ||
634 | * byte stream buffer that comes back from the _CRS method | ||
635 | * execution. | ||
636 | */ | ||
637 | status = acpi_rs_create_resource_list(obj_desc, ret_buffer); | ||
638 | |||
639 | /* On exit, we must delete the object returned by evaluate_object */ | ||
640 | |||
641 | acpi_ut_remove_reference(obj_desc); | ||
642 | return_ACPI_STATUS(status); | ||
643 | } | ||
644 | |||
645 | /******************************************************************************* | ||
646 | * | ||
597 | * FUNCTION: acpi_rs_get_method_data | 647 | * FUNCTION: acpi_rs_get_method_data |
598 | * | 648 | * |
599 | * PARAMETERS: Handle - Handle to the containing object | 649 | * PARAMETERS: Handle - Handle to the containing object |
diff --git a/drivers/acpi/acpica/rsxface.c b/drivers/acpi/acpica/rsxface.c index fe86b37b16ce..45a9e5e4e4db 100644 --- a/drivers/acpi/acpica/rsxface.c +++ b/drivers/acpi/acpica/rsxface.c | |||
@@ -307,6 +307,46 @@ acpi_set_current_resources(acpi_handle device_handle, | |||
307 | 307 | ||
308 | ACPI_EXPORT_SYMBOL(acpi_set_current_resources) | 308 | ACPI_EXPORT_SYMBOL(acpi_set_current_resources) |
309 | 309 | ||
310 | /******************************************************************************* | ||
311 | * | ||
312 | * FUNCTION: acpi_get_event_resources | ||
313 | * | ||
314 | * PARAMETERS: device_handle - Handle to the device object for the | ||
315 | * device we are getting resources | ||
316 | * in_buffer - Pointer to a buffer containing the | ||
317 | * resources to be set for the device | ||
318 | * | ||
319 | * RETURN: Status | ||
320 | * | ||
321 | * DESCRIPTION: This function is called to get the event resources for a | ||
322 | * specific device. The caller must first acquire a handle for | ||
323 | * the desired device. The resource data is passed to the routine | ||
324 | * the buffer pointed to by the in_buffer variable. Uses the | ||
325 | * _AEI method. | ||
326 | * | ||
327 | ******************************************************************************/ | ||
328 | acpi_status | ||
329 | acpi_get_event_resources(acpi_handle device_handle, | ||
330 | struct acpi_buffer *ret_buffer) | ||
331 | { | ||
332 | acpi_status status; | ||
333 | struct acpi_namespace_node *node; | ||
334 | |||
335 | ACPI_FUNCTION_TRACE(acpi_get_event_resources); | ||
336 | |||
337 | /* Validate parameters then dispatch to internal routine */ | ||
338 | |||
339 | status = acpi_rs_validate_parameters(device_handle, ret_buffer, &node); | ||
340 | if (ACPI_FAILURE(status)) { | ||
341 | return_ACPI_STATUS(status); | ||
342 | } | ||
343 | |||
344 | status = acpi_rs_get_aei_method_data(node, ret_buffer); | ||
345 | return_ACPI_STATUS(status); | ||
346 | } | ||
347 | |||
348 | ACPI_EXPORT_SYMBOL(acpi_get_event_resources) | ||
349 | |||
310 | /****************************************************************************** | 350 | /****************************************************************************** |
311 | * | 351 | * |
312 | * FUNCTION: acpi_resource_to_address64 | 352 | * FUNCTION: acpi_resource_to_address64 |