Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 154154
b: refs/heads/master
c: fbe2b31
h: refs/heads/master
v: v3
  • Loading branch information
Bjorn Helgaas authored and Len Brown committed Jun 20, 2009
1 parent 2bbdb31 commit 1a9ff3c
Show file tree
Hide file tree
Showing 12 changed files with 418 additions and 215 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7fe2a6c275a5bcec52fb3ef643daaf8265b7af0d
refs/heads/master: fbe2b31b4b6dfa790cbc88e00631f3112c4fc54e
40 changes: 40 additions & 0 deletions trunk/drivers/acpi/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,46 @@ struct device *acpi_get_physical_device(acpi_handle handle)

EXPORT_SYMBOL(acpi_get_physical_device);

/* ToDo: When a PCI bridge is found, return the PCI device behind the bridge
* This should work in general, but did not on a Lenovo T61 for the
* graphics card. But this must be fixed when the PCI device is
* bound and the kernel device struct is attached to the acpi device
* Note: A success call will increase reference count by one
* Do call put_device(dev) on the returned device then
*/
struct device *acpi_get_physical_pci_device(acpi_handle handle)
{
struct device *dev;
long long device_id;
acpi_status status;

status =
acpi_evaluate_integer(handle, "_ADR", NULL, &device_id);

if (ACPI_FAILURE(status))
return NULL;

/* We need to attempt to determine whether the _ADR refers to a
PCI device or not. There's no terribly good way to do this,
so the best we can hope for is to assume that there'll never
be a device in the host bridge */
if (device_id >= 0x10000) {
/* It looks like a PCI device. Does it exist? */
dev = acpi_get_physical_device(handle);
} else {
/* It doesn't look like a PCI device. Does its parent
exist? */
acpi_handle phandle;
if (acpi_get_parent(handle, &phandle))
return NULL;
dev = acpi_get_physical_device(phandle);
}
if (!dev)
return NULL;
return dev;
}
EXPORT_SYMBOL(acpi_get_physical_pci_device);

static int acpi_bind_one(struct device *dev, acpi_handle handle)
{
struct acpi_device *acpi_dev;
Expand Down
Loading

0 comments on commit 1a9ff3c

Please sign in to comment.