aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/nsxfname.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2012-10-30 22:28:38 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-11-14 18:31:30 -0500
commit413fc3f592c65977858f8adce2e7af0e82aa1191 (patch)
treeba673bcb511b48dd0cf96f793fe2de28c978218a /drivers/acpi/acpica/nsxfname.c
parent17b1f45a68ebd7944904a801d81a5c4206f9f76b (diff)
ACPICA: AcpiGetObjectInfo: Add support for ACPI 5 _SUB method
Now calls _SUB in addition to the other ID methods: _HID, _CID, and _UID. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/nsxfname.c')
-rw-r--r--drivers/acpi/acpica/nsxfname.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/drivers/acpi/acpica/nsxfname.c b/drivers/acpi/acpica/nsxfname.c
index 2d10df2ef660..811c6f13f476 100644
--- a/drivers/acpi/acpica/nsxfname.c
+++ b/drivers/acpi/acpica/nsxfname.c
@@ -231,6 +231,7 @@ static char *acpi_ns_copy_device_id(struct acpi_pnp_device_id *dest,
231 struct acpi_pnp_device_id *source, 231 struct acpi_pnp_device_id *source,
232 char *string_area) 232 char *string_area)
233{ 233{
234
234 /* Create the destination PNP_DEVICE_ID */ 235 /* Create the destination PNP_DEVICE_ID */
235 236
236 dest->string = string_area; 237 dest->string = string_area;
@@ -255,8 +256,8 @@ static char *acpi_ns_copy_device_id(struct acpi_pnp_device_id *dest,
255 * namespace node and possibly by running several standard 256 * namespace node and possibly by running several standard
256 * control methods (Such as in the case of a device.) 257 * control methods (Such as in the case of a device.)
257 * 258 *
258 * For Device and Processor objects, run the Device _HID, _UID, _CID, _STA, 259 * For Device and Processor objects, run the Device _HID, _UID, _CID, _SUB,
259 * _ADR, _sx_w, and _sx_d methods. 260 * _STA, _ADR, _sx_w, and _sx_d methods.
260 * 261 *
261 * Note: Allocates the return buffer, must be freed by the caller. 262 * Note: Allocates the return buffer, must be freed by the caller.
262 * 263 *
@@ -271,6 +272,7 @@ acpi_get_object_info(acpi_handle handle,
271 struct acpi_pnp_device_id_list *cid_list = NULL; 272 struct acpi_pnp_device_id_list *cid_list = NULL;
272 struct acpi_pnp_device_id *hid = NULL; 273 struct acpi_pnp_device_id *hid = NULL;
273 struct acpi_pnp_device_id *uid = NULL; 274 struct acpi_pnp_device_id *uid = NULL;
275 struct acpi_pnp_device_id *sub = NULL;
274 char *next_id_string; 276 char *next_id_string;
275 acpi_object_type type; 277 acpi_object_type type;
276 acpi_name name; 278 acpi_name name;
@@ -315,7 +317,7 @@ acpi_get_object_info(acpi_handle handle,
315 if ((type == ACPI_TYPE_DEVICE) || (type == ACPI_TYPE_PROCESSOR)) { 317 if ((type == ACPI_TYPE_DEVICE) || (type == ACPI_TYPE_PROCESSOR)) {
316 /* 318 /*
317 * Get extra info for ACPI Device/Processor objects only: 319 * Get extra info for ACPI Device/Processor objects only:
318 * Run the Device _HID, _UID, and _CID methods. 320 * Run the Device _HID, _UID, _SUB, and _CID methods.
319 * 321 *
320 * Note: none of these methods are required, so they may or may 322 * Note: none of these methods are required, so they may or may
321 * not be present for this device. The Info->Valid bitfield is used 323 * not be present for this device. The Info->Valid bitfield is used
@@ -338,6 +340,14 @@ acpi_get_object_info(acpi_handle handle,
338 valid |= ACPI_VALID_UID; 340 valid |= ACPI_VALID_UID;
339 } 341 }
340 342
343 /* Execute the Device._SUB method */
344
345 status = acpi_ut_execute_SUB(node, &sub);
346 if (ACPI_SUCCESS(status)) {
347 info_size += sub->length;
348 valid |= ACPI_VALID_SUB;
349 }
350
341 /* Execute the Device._CID method */ 351 /* Execute the Device._CID method */
342 352
343 status = acpi_ut_execute_CID(node, &cid_list); 353 status = acpi_ut_execute_CID(node, &cid_list);
@@ -425,8 +435,9 @@ acpi_get_object_info(acpi_handle handle,
425 } 435 }
426 436
427 /* 437 /*
428 * Copy the HID, UID, and CIDs to the return buffer. The variable-length 438 * Copy the HID, UID, SUB, and CIDs to the return buffer.
429 * strings are copied to the reserved area at the end of the buffer. 439 * The variable-length strings are copied to the reserved area
440 * at the end of the buffer.
430 * 441 *
431 * For HID and CID, check if the ID is a PCI Root Bridge. 442 * For HID and CID, check if the ID is a PCI Root Bridge.
432 */ 443 */
@@ -444,6 +455,11 @@ acpi_get_object_info(acpi_handle handle,
444 uid, next_id_string); 455 uid, next_id_string);
445 } 456 }
446 457
458 if (sub) {
459 next_id_string = acpi_ns_copy_device_id(&info->subsystem_id,
460 sub, next_id_string);
461 }
462
447 if (cid_list) { 463 if (cid_list) {
448 info->compatible_id_list.count = cid_list->count; 464 info->compatible_id_list.count = cid_list->count;
449 info->compatible_id_list.list_size = cid_list->list_size; 465 info->compatible_id_list.list_size = cid_list->list_size;
@@ -480,6 +496,9 @@ acpi_get_object_info(acpi_handle handle,
480 if (uid) { 496 if (uid) {
481 ACPI_FREE(uid); 497 ACPI_FREE(uid);
482 } 498 }
499 if (sub) {
500 ACPI_FREE(sub);
501 }
483 if (cid_list) { 502 if (cid_list) {
484 ACPI_FREE(cid_list); 503 ACPI_FREE(cid_list);
485 } 504 }