summaryrefslogtreecommitdiffstats
path: root/sys/dev/acpica
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
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')
-rw-r--r--sys/dev/acpica/acpi_powerres.c32
-rw-r--r--sys/dev/acpica/acpi_thermal.c16
2 files changed, 37 insertions, 11 deletions
diff --git a/sys/dev/acpica/acpi_powerres.c b/sys/dev/acpica/acpi_powerres.c
index 2836cde..1526a93 100644
--- a/sys/dev/acpica/acpi_powerres.c
+++ b/sys/dev/acpica/acpi_powerres.c
@@ -485,19 +485,29 @@ acpi_pwr_reference_resource(ACPI_OBJECT *obj, void *arg)
ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
/* check the object type */
- if (obj->Type != ACPI_TYPE_STRING) {
- ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "don't know how to create a power reference to object type %d\n",
- obj->Type));
- return_VOID;
- }
+ switch (obj->Type) {
+ case ACPI_TYPE_ANY:
+ ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "building reference from %s to %s\n",
+ acpi_name(pc->ac_consumer), acpi_name(obj->Reference.Handle)));
+
+ res = obj->Reference.Handle;
+ break;
- ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "building reference from %s to %s\n",
- acpi_name(pc->ac_consumer), obj->String.Pointer));
+ case ACPI_TYPE_STRING:
+ ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "building reference from %s to %s\n",
+ acpi_name(pc->ac_consumer), obj->String.Pointer));
- /* get the handle of the resource */
- if (ACPI_FAILURE(status = AcpiGetHandle(NULL, obj->String.Pointer, &res))) {
- ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "couldn't find power resource %s\n",
- obj->String.Pointer));
+ /* get the handle of the resource */
+ if (ACPI_FAILURE(status = AcpiGetHandle(NULL, obj->String.Pointer, &res))) {
+ ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "couldn't find power resource %s\n",
+ obj->String.Pointer));
+ return_VOID;
+ }
+ break;
+
+ default:
+ ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "don't know how to create a power reference to object type %d\n",
+ obj->Type));
return_VOID;
}
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