aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/evrgnini.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2009-06-29 01:39:29 -0400
committerLen Brown <len.brown@intel.com>2009-08-27 10:17:15 -0400
commit15b8dd53f5ffaf8e2d9095c423f713423f576c0f (patch)
tree773f09435b14a810372642502352d46c29b6f148 /drivers/acpi/acpica/evrgnini.c
parent9c61b34cf7078da72cce276ff8cfae5d6e9955bc (diff)
ACPICA: Major update for acpi_get_object_info external interface
Completed a major update for the acpi_get_object_info external interface. Changes include: - Support for variable, unlimited length HID, UID, and CID strings - Support Processor objects the same as Devices (HID,UID,CID,ADR,STA, etc.) - Call the _SxW power methods on behalf of a device object - Determine if a device is a PCI root bridge - Change the ACPI_BUFFER parameter to ACPI_DEVICE_INFO. These changes will require an update to all callers of this interface. See the ACPICA Programmer Reference for details. Also, update all invocations of acpi_get_object_info interface 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/evrgnini.c')
-rw-r--r--drivers/acpi/acpica/evrgnini.c45
1 files changed, 8 insertions, 37 deletions
diff --git a/drivers/acpi/acpica/evrgnini.c b/drivers/acpi/acpica/evrgnini.c
index 284a7becbe96..cf29c4953028 100644
--- a/drivers/acpi/acpica/evrgnini.c
+++ b/drivers/acpi/acpica/evrgnini.c
@@ -50,8 +50,6 @@
50ACPI_MODULE_NAME("evrgnini") 50ACPI_MODULE_NAME("evrgnini")
51 51
52/* Local prototypes */ 52/* Local prototypes */
53static u8 acpi_ev_match_pci_root_bridge(char *id);
54
55static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node); 53static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node);
56 54
57/******************************************************************************* 55/*******************************************************************************
@@ -332,37 +330,6 @@ acpi_ev_pci_config_region_setup(acpi_handle handle,
332 330
333/******************************************************************************* 331/*******************************************************************************
334 * 332 *
335 * FUNCTION: acpi_ev_match_pci_root_bridge
336 *
337 * PARAMETERS: Id - The HID/CID in string format
338 *
339 * RETURN: TRUE if the Id is a match for a PCI/PCI-Express Root Bridge
340 *
341 * DESCRIPTION: Determine if the input ID is a PCI Root Bridge ID.
342 *
343 ******************************************************************************/
344
345static u8 acpi_ev_match_pci_root_bridge(char *id)
346{
347
348 /*
349 * Check if this is a PCI root.
350 * ACPI 3.0+: check for a PCI Express root also.
351 */
352 if (!(ACPI_STRNCMP(id,
353 PCI_ROOT_HID_STRING,
354 sizeof(PCI_ROOT_HID_STRING))) ||
355 !(ACPI_STRNCMP(id,
356 PCI_EXPRESS_ROOT_HID_STRING,
357 sizeof(PCI_EXPRESS_ROOT_HID_STRING)))) {
358 return (TRUE);
359 }
360
361 return (FALSE);
362}
363
364/*******************************************************************************
365 *
366 * FUNCTION: acpi_ev_is_pci_root_bridge 333 * FUNCTION: acpi_ev_is_pci_root_bridge
367 * 334 *
368 * PARAMETERS: Node - Device node being examined 335 * PARAMETERS: Node - Device node being examined
@@ -377,9 +344,10 @@ static u8 acpi_ev_match_pci_root_bridge(char *id)
377static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node) 344static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node)
378{ 345{
379 acpi_status status; 346 acpi_status status;
380 struct acpica_device_id hid; 347 struct acpica_device_id *hid;
381 struct acpi_compatible_id_list *cid; 348 struct acpica_device_id_list *cid;
382 u32 i; 349 u32 i;
350 u8 match;
383 351
384 /* Get the _HID and check for a PCI Root Bridge */ 352 /* Get the _HID and check for a PCI Root Bridge */
385 353
@@ -388,7 +356,10 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node)
388 return (FALSE); 356 return (FALSE);
389 } 357 }
390 358
391 if (acpi_ev_match_pci_root_bridge(hid.value)) { 359 match = acpi_ut_is_pci_root_bridge(hid->string);
360 ACPI_FREE(hid);
361
362 if (match) {
392 return (TRUE); 363 return (TRUE);
393 } 364 }
394 365
@@ -402,7 +373,7 @@ static u8 acpi_ev_is_pci_root_bridge(struct acpi_namespace_node *node)
402 /* Check all _CIDs in the returned list */ 373 /* Check all _CIDs in the returned list */
403 374
404 for (i = 0; i < cid->count; i++) { 375 for (i = 0; i < cid->count; i++) {
405 if (acpi_ev_match_pci_root_bridge(cid->id[i].value)) { 376 if (acpi_ut_is_pci_root_bridge(cid->ids[i].string)) {
406 ACPI_FREE(cid); 377 ACPI_FREE(cid);
407 return (TRUE); 378 return (TRUE);
408 } 379 }