Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 350837
b: refs/heads/master
c: 38a9a67
h: refs/heads/master
i:
  350835: d6a5bf8
v: v3
  • Loading branch information
Rafael J. Wysocki committed Jan 3, 2013
1 parent 14560e1 commit 818281f
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 158 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: d2e5f0c16ad60a7208fd371233e63b73c990ece2
refs/heads/master: 38a9a67a281eeebcd7cccf87f0e371f58ae625e3
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ acpi-y += resource.o
acpi-y += processor_core.o
acpi-y += ec.o
acpi-$(CONFIG_ACPI_DOCK) += dock.o
acpi-y += pci_root.o pci_link.o pci_irq.o pci_bind.o
acpi-y += pci_root.o pci_link.o pci_irq.o
acpi-y += acpi_platform.o
acpi-y += power.o
acpi-y += event.o
Expand Down
117 changes: 0 additions & 117 deletions trunk/drivers/acpi/pci_bind.c

This file was deleted.

31 changes: 0 additions & 31 deletions trunk/drivers/acpi/pci_root.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,21 +186,6 @@ static acpi_status try_get_root_bridge_busnr(acpi_handle handle,
return AE_OK;
}

static void acpi_pci_bridge_scan(struct acpi_device *device)
{
int status;
struct acpi_device *child = NULL;

if (device->flags.bus_address)
if (device->parent && device->parent->ops.bind) {
status = device->parent->ops.bind(device);
if (!status) {
list_for_each_entry(child, &device->children, node)
acpi_pci_bridge_scan(child);
}
}
}

static u8 pci_osc_uuid_str[] = "33DB4D5B-1FF7-401C-9657-7441C03DD766";

static acpi_status acpi_pci_run_osc(acpi_handle handle,
Expand Down Expand Up @@ -450,7 +435,6 @@ static int acpi_pci_root_add(struct acpi_device *device)
int result;
struct acpi_pci_root *root;
acpi_handle handle;
struct acpi_device *child;
struct acpi_pci_driver *driver;
u32 flags, base_flags;
bool is_osc_granted = false;
Expand Down Expand Up @@ -602,21 +586,6 @@ static int acpi_pci_root_add(struct acpi_device *device)
goto out_del_root;
}

/*
* Attach ACPI-PCI Context
* -----------------------
* Thus binding the ACPI and PCI devices.
*/
result = acpi_pci_bind_root(device);
if (result)
goto out_del_root;

/*
* Scan and bind all _ADR-Based Devices
*/
list_for_each_entry(child, &device->children, node)
acpi_pci_bridge_scan(child);

/* ASPM setting */
if (is_osc_granted) {
if (acpi_gbl_FADT.boot_flags & ACPI_FADT_NO_ASPM)
Expand Down
44 changes: 36 additions & 8 deletions trunk/drivers/pci/pci-acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,12 +320,33 @@ static int acpi_pci_find_root_bridge(struct device *dev, acpi_handle *handle)
return 0;
}

static void acpi_pci_wakeup_setup(struct device *dev)
static void pci_acpi_setup(struct device *dev)
{
struct acpi_device *adev = acpi_dev_pm_get_node(dev);
struct pci_dev *pci_dev = to_pci_dev(dev);
acpi_handle handle = ACPI_HANDLE(dev);
struct acpi_device *adev;
acpi_status status;
acpi_handle dummy;

if (!adev || !adev->wakeup.flags.valid)
/*
* Evaluate and parse _PRT, if exists. This code allows parsing of
* _PRT objects within the scope of non-bridge devices. Note that
* _PRTs within the scope of a PCI bridge assume the bridge's
* subordinate bus number.
*
* TBD: Can _PRTs exist within the scope of non-bridge PCI devices?
*/
status = acpi_get_handle(handle, METHOD_NAME__PRT, &dummy);
if (ACPI_SUCCESS(status)) {
unsigned char bus;

bus = pci_dev->subordinate ?
pci_dev->subordinate->number : pci_dev->bus->number;
acpi_pci_irq_add_prt(handle, pci_domain_nr(pci_dev->bus), bus);
}

acpi_power_resource_register_device(dev, handle);
if (acpi_bus_get_device(handle, &adev) || !adev->wakeup.flags.valid)
return;

device_set_wakeup_capable(dev, true);
Expand All @@ -336,23 +357,30 @@ static void acpi_pci_wakeup_setup(struct device *dev)
device_set_run_wake(dev, true);
}

static void acpi_pci_wakeup_cleanup(struct device *dev)
static void pci_acpi_cleanup(struct device *dev)
{
struct acpi_device *adev = acpi_dev_pm_get_node(dev);
struct pci_dev *pci_dev = to_pci_dev(dev);
acpi_handle handle = ACPI_HANDLE(dev);
struct acpi_device *adev;

if (adev && adev->wakeup.flags.valid) {
if (!acpi_bus_get_device(handle, &adev) && adev->wakeup.flags.valid) {
device_set_wakeup_capable(dev, false);
device_set_run_wake(dev, false);
pci_acpi_remove_pm_notifier(adev);
}
acpi_power_resource_unregister_device(dev, handle);

if (pci_dev->subordinate)
acpi_pci_irq_del_prt(pci_domain_nr(pci_dev->bus),
pci_dev->subordinate->number);
}

static struct acpi_bus_type acpi_pci_bus = {
.bus = &pci_bus_type,
.find_device = acpi_pci_find_device,
.find_bridge = acpi_pci_find_root_bridge,
.setup = acpi_pci_wakeup_setup,
.cleanup = acpi_pci_wakeup_cleanup,
.setup = pci_acpi_setup,
.cleanup = pci_acpi_cleanup,
};

static int __init acpi_pci_init(void)
Expand Down

0 comments on commit 818281f

Please sign in to comment.