summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpi_button.c
diff options
context:
space:
mode:
authornjl <njl@FreeBSD.org>2004-06-13 22:52:30 +0000
committernjl <njl@FreeBSD.org>2004-06-13 22:52:30 +0000
commitd49f147c3f337c27d40d40e625f0b8895b9c6c0f (patch)
treed2dac6905b64b7bcc7fe4fdc69df38b6c7dc9629 /sys/dev/acpica/acpi_button.c
parent05af3d5b81d06efd1f5a8cf33121efd504b922c0 (diff)
downloadFreeBSD-src-d49f147c3f337c27d40d40e625f0b8895b9c6c0f.zip
FreeBSD-src-d49f147c3f337c27d40d40e625f0b8895b9c6c0f.tar.gz
Add support to ACPI to manage its own resources. Previously, resource
allocation was passed up to nexus. Now, we probe sysresource objects and manage the resources they describe in a local rman pool. This helps devices which attach/detach varying resources (like the _CST object) and module loads/unloads. The allocation/release routines now check to see if the resource is described in a child sysresource object and if so, allocate from the local rman. Sysresource objects add their resources to the pool and reserve them upon boot. This means sysresources need to be probed before other ACPI devices. Changes include: * Add ordering to the child device probe. The current order is: system resource objects, embedded controllers, then everything else. * Make acpi_MatchHid take a handle instead of a device_t arg. * Replace acpi_{get,set}_resource with the generic equivalents.
Diffstat (limited to 'sys/dev/acpica/acpi_button.c')
-rw-r--r--sys/dev/acpica/acpi_button.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/acpica/acpi_button.c b/sys/dev/acpica/acpi_button.c
index 8314486..4ea77db 100644
--- a/sys/dev/acpica/acpi_button.c
+++ b/sys/dev/acpica/acpi_button.c
@@ -90,24 +90,26 @@ static int
acpi_button_probe(device_t dev)
{
struct acpi_button_softc *sc;
+ ACPI_HANDLE h;
int ret = ENXIO;
+ h = acpi_get_handle(dev);
sc = device_get_softc(dev);
if (acpi_get_type(dev) == ACPI_TYPE_DEVICE && !acpi_disabled("button")) {
- if (acpi_MatchHid(dev, "PNP0C0C")) {
+ if (acpi_MatchHid(h, "PNP0C0C")) {
device_set_desc(dev, "Power Button");
sc->button_type = ACPI_POWER_BUTTON;
ret = 0;
- } else if (acpi_MatchHid(dev, "ACPI_FPB")) {
+ } else if (acpi_MatchHid(h, "ACPI_FPB")) {
device_set_desc(dev, "Power Button (fixed)");
sc->button_type = ACPI_POWER_BUTTON;
sc->fixed = 1;
ret = 0;
- } else if (acpi_MatchHid(dev, "PNP0C0E")) {
+ } else if (acpi_MatchHid(h, "PNP0C0E")) {
device_set_desc(dev, "Sleep Button");
sc->button_type = ACPI_SLEEP_BUTTON;
ret = 0;
- } else if (acpi_MatchHid(dev, "ACPI_FSB")) {
+ } else if (acpi_MatchHid(h, "ACPI_FSB")) {
device_set_desc(dev, "Sleep Button (fixed)");
sc->button_type = ACPI_SLEEP_BUTTON;
sc->fixed = 1;
OpenPOWER on IntegriCloud