diff options
author | jhb <jhb@FreeBSD.org> | 2010-08-17 15:44:52 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2010-08-17 15:44:52 +0000 |
commit | bdd8e8fe8136f157b255a622399032dcf47662d2 (patch) | |
tree | 7e13c86907c1bb2b489ada14a16a8f0aff8ab799 /sys/dev/acpica | |
parent | 4a63dcd164c0bd8e31b77d5417250b805bf3e06b (diff) | |
download | FreeBSD-src-bdd8e8fe8136f157b255a622399032dcf47662d2.zip FreeBSD-src-bdd8e8fe8136f157b255a622399032dcf47662d2.tar.gz |
Add a new method to the PCI bridge interface, PCIB_POWER_FOR_SLEEP(). This
method is used by the PCI bus driver to query the power management system
to determine the proper device state to be used for a device during suspend
and resume. For the ACPI PCI bridge drivers this calls
acpi_device_pwr_for_sleep(). This removes ACPI-specific knowledge from
the PCI and PCI-PCI bridge drivers.
Reviewed by: jkim
Diffstat (limited to 'sys/dev/acpica')
-rw-r--r-- | sys/dev/acpica/acpi.c | 4 | ||||
-rw-r--r-- | sys/dev/acpica/acpi_pcib.c | 11 | ||||
-rw-r--r-- | sys/dev/acpica/acpi_pcib_acpi.c | 1 | ||||
-rw-r--r-- | sys/dev/acpica/acpi_pcib_pci.c | 1 | ||||
-rw-r--r-- | sys/dev/acpica/acpi_pcibvar.h | 2 | ||||
-rw-r--r-- | sys/dev/acpica/acpivar.h | 2 |
6 files changed, 18 insertions, 3 deletions
diff --git a/sys/dev/acpica/acpi.c b/sys/dev/acpica/acpi.c index f173dc3..feef2cc 100644 --- a/sys/dev/acpica/acpi.c +++ b/sys/dev/acpica/acpi.c @@ -129,8 +129,6 @@ static char *acpi_device_id_probe(device_t bus, device_t dev, char **ids); static ACPI_STATUS acpi_device_eval_obj(device_t bus, device_t dev, ACPI_STRING pathname, ACPI_OBJECT_LIST *parameters, ACPI_BUFFER *ret); -static int acpi_device_pwr_for_sleep(device_t bus, device_t dev, - int *dstate); static ACPI_STATUS acpi_device_scan_cb(ACPI_HANDLE h, UINT32 level, void *context, void **retval); static ACPI_STATUS acpi_device_scan_children(device_t bus, device_t dev, @@ -1415,7 +1413,7 @@ acpi_device_eval_obj(device_t bus, device_t dev, ACPI_STRING pathname, return (AcpiEvaluateObject(h, pathname, parameters, ret)); } -static int +int acpi_device_pwr_for_sleep(device_t bus, device_t dev, int *dstate) { struct acpi_softc *sc; diff --git a/sys/dev/acpica/acpi_pcib.c b/sys/dev/acpica/acpi_pcib.c index 65996f5..1b26b4f 100644 --- a/sys/dev/acpica/acpi_pcib.c +++ b/sys/dev/acpica/acpi_pcib.c @@ -275,3 +275,14 @@ out: return_VALUE (interrupt); } + +int +acpi_pcib_power_for_sleep(device_t pcib, device_t dev, int *pstate) +{ + device_t acpi_dev; + + acpi_dev = devclass_get_device(devclass_find("acpi"), 0); + acpi_device_pwr_for_sleep(acpi_dev, dev, pstate); + return (0); +} + diff --git a/sys/dev/acpica/acpi_pcib_acpi.c b/sys/dev/acpica/acpi_pcib_acpi.c index 7275330..2ea9f2c 100644 --- a/sys/dev/acpica/acpi_pcib_acpi.c +++ b/sys/dev/acpica/acpi_pcib_acpi.c @@ -116,6 +116,7 @@ static device_method_t acpi_pcib_acpi_methods[] = { DEVMETHOD(pcib_alloc_msix, acpi_pcib_alloc_msix), DEVMETHOD(pcib_release_msix, pcib_release_msix), DEVMETHOD(pcib_map_msi, acpi_pcib_map_msi), + DEVMETHOD(pcib_power_for_sleep, acpi_pcib_power_for_sleep), {0, 0} }; diff --git a/sys/dev/acpica/acpi_pcib_pci.c b/sys/dev/acpica/acpi_pcib_pci.c index 2196940..a766981 100644 --- a/sys/dev/acpica/acpi_pcib_pci.c +++ b/sys/dev/acpica/acpi_pcib_pci.c @@ -80,6 +80,7 @@ static device_method_t acpi_pcib_pci_methods[] = { /* pcib interface */ DEVMETHOD(pcib_route_interrupt, acpi_pcib_pci_route_interrupt), + DEVMETHOD(pcib_power_for_sleep, acpi_pcib_power_for_sleep), {0, 0} }; diff --git a/sys/dev/acpica/acpi_pcibvar.h b/sys/dev/acpica/acpi_pcibvar.h index 00e03fa..9a4be07 100644 --- a/sys/dev/acpica/acpi_pcibvar.h +++ b/sys/dev/acpica/acpi_pcibvar.h @@ -38,6 +38,8 @@ int acpi_pci_link_route_interrupt(device_t dev, int index); int acpi_pcib_attach(device_t bus, ACPI_BUFFER *prt, int busno); int acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin, ACPI_BUFFER *prtbuf); +int acpi_pcib_power_for_sleep(device_t pcib, device_t dev, + int *pstate); #endif /* _KERNEL */ diff --git a/sys/dev/acpica/acpivar.h b/sys/dev/acpica/acpivar.h index adc9d6e..34284d5 100644 --- a/sys/dev/acpica/acpivar.h +++ b/sys/dev/acpica/acpivar.h @@ -393,6 +393,8 @@ EVENTHANDLER_DECLARE(acpi_wakeup_event, acpi_event_handler_t); /* Device power control. */ ACPI_STATUS acpi_pwr_wake_enable(ACPI_HANDLE consumer, int enable); ACPI_STATUS acpi_pwr_switch_consumer(ACPI_HANDLE consumer, int state); +int acpi_device_pwr_for_sleep(device_t bus, device_t dev, + int *dstate); /* Misc. */ static __inline struct acpi_softc * |