diff --git a/sys/dev/acpica/acpi_powerres.c b/sys/dev/acpica/acpi_powerres.c index 2836cde12e0f..1526a933372c 100644 --- a/sys/dev/acpica/acpi_powerres.c +++ b/sys/dev/acpica/acpi_powerres.c @@ -485,22 +485,32 @@ 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) { + 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; + + 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)); + 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; } - 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)); - return_VOID; - } - /* create/look up the resource */ if (ACPI_FAILURE(status = acpi_pwr_register_resource(res))) { ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "couldn't register power resource %s - %s\n", diff --git a/sys/dev/acpica/acpi_thermal.c b/sys/dev/acpica/acpi_thermal.c index 10ce7b2da344..d78127296da5 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));