summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica/acpi_thermal.c
diff options
context:
space:
mode:
authoriwasaki <iwasaki@FreeBSD.org>2002-08-27 07:53:55 +0000
committeriwasaki <iwasaki@FreeBSD.org>2002-08-27 07:53:55 +0000
commit43e660c9693cdacb348cbcd3b0aee3500741bf5c (patch)
tree1a758c51000ba7d718ab877e2658ab8b36c32d6d /sys/dev/acpica/acpi_thermal.c
parent57e404b3cda41ba70f521b902a025a612e6ae189 (diff)
downloadFreeBSD-src-43e660c9693cdacb348cbcd3b0aee3500741bf5c.zip
FreeBSD-src-43e660c9693cdacb348cbcd3b0aee3500741bf5c.tar.gz
Fix a bug about the cooling system controlling in acpi_thermal driver.
Recent version of ACPI CA returns the package object which contains object reference elements if the elements are named objects. We need to be careful when you use acpi_ForeachPackageObject() in new code...
Diffstat (limited to 'sys/dev/acpica/acpi_thermal.c')
-rw-r--r--sys/dev/acpica/acpi_thermal.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys/dev/acpica/acpi_thermal.c b/sys/dev/acpica/acpi_thermal.c
index 10ce7b2..d781272 100644
--- a/sys/dev/acpica/acpi_thermal.c
+++ b/sys/dev/acpica/acpi_thermal.c
@@ -536,6 +536,12 @@ acpi_tz_switch_cooler_off(ACPI_OBJECT *obj, void *arg)
ACPI_ASSERTLOCK;
switch(obj->Type) {
+ case ACPI_TYPE_ANY:
+ ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "called to turn %s off\n", acpi_name(obj->Reference.Handle)));
+
+ acpi_pwr_switch_consumer(obj->Reference.Handle, ACPI_STATE_D3);
+ break;
+
case ACPI_TYPE_STRING:
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "called to turn %s off\n", obj->String.Pointer));
@@ -576,6 +582,16 @@ acpi_tz_switch_cooler_on(ACPI_OBJECT *obj, void *arg)
ACPI_ASSERTLOCK;
switch(obj->Type) {
+ case ACPI_TYPE_ANY:
+ ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "called to turn %s on\n", acpi_name(obj->Reference.Handle)));
+
+ if (ACPI_FAILURE(status = acpi_pwr_switch_consumer(obj->Reference.Handle, ACPI_STATE_D0))) {
+ ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev),
+ "failed to activate %s - %s\n", acpi_name(obj->Reference.Handle),
+ AcpiFormatException(status));
+ }
+ break;
+
case ACPI_TYPE_STRING:
ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "called to turn %s on\n", obj->String.Pointer));
OpenPOWER on IntegriCloud