Lines Matching +full:cooling +full:- +full:levels
1 /*-
56 #define TZ_KELVTOC(x) (((x) - TZ_ZEROC) / 10), abs(((x) - TZ_ZEROC) % 10)
59 #define TZ_NOTIFY_LEVELS 0x81 /* Cooling levels changed. */
70 #define TZ_NOTIFYCOUNT (TZ_VALIDCHECKS - 1)
92 int tz_active; /*Current active cooling*/
93 #define TZ_ACTIVE_NONE -1
94 #define TZ_ACTIVE_UNKNOWN -2
95 int tz_requested; /*Minimum active cooling*/
96 int tz_thflags; /*Current temp-related flags*/
107 /*Current cooling starting time*/
117 /* passive cooling */
174 /* Minimum cooling run time */
183 static int acpi_tz_cooling_unit = -1;
192 result = -10; in acpi_tz_probe()
209 sc->tz_dev = dev; in acpi_tz_attach()
210 sc->tz_handle = acpi_get_handle(dev); in acpi_tz_attach()
211 sc->tz_requested = TZ_ACTIVE_NONE; in acpi_tz_attach()
212 sc->tz_active = TZ_ACTIVE_UNKNOWN; in acpi_tz_attach()
213 sc->tz_thflags = TZ_THFLAG_NONE; in acpi_tz_attach()
214 sc->tz_cooling_proc = NULL; in acpi_tz_attach()
215 sc->tz_cooling_proc_running = FALSE; in acpi_tz_attach()
216 sc->tz_cooling_active = FALSE; in acpi_tz_attach()
217 sc->tz_cooling_updated = FALSE; in acpi_tz_attach()
218 sc->tz_cooling_enabled = FALSE; in acpi_tz_attach()
231 AcpiInstallNotifyHandler(sc->tz_handle, ACPI_DEVICE_NOTIFY, in acpi_tz_attach()
243 SYSCTL_CHILDREN(acpi_sc->acpi_sysctl_tree), OID_AUTO, "thermal", in acpi_tz_attach()
249 "minimum cooling run time in sec"); in acpi_tz_attach()
259 sysctl_ctx_init(&sc->tz_sysctl_ctx); in acpi_tz_attach()
261 sc->tz_sysctl_tree = SYSCTL_ADD_NODE_WITH_LABEL(&sc->tz_sysctl_ctx, in acpi_tz_attach()
264 SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), in acpi_tz_attach()
266 &sc->tz_temperature, 0, sysctl_handle_int, "IK", in acpi_tz_attach()
268 SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), in acpi_tz_attach()
270 0, acpi_tz_active_sysctl, "I", "cooling is active"); in acpi_tz_attach()
271 SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), in acpi_tz_attach()
275 "enable passive (speed reduction) cooling"); in acpi_tz_attach()
277 SYSCTL_ADD_INT(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), in acpi_tz_attach()
279 &sc->tz_thflags, 0, "thermal zone flags"); in acpi_tz_attach()
280 SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), in acpi_tz_attach()
283 "passive cooling temp setpoint"); in acpi_tz_attach()
284 SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), in acpi_tz_attach()
288 SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), in acpi_tz_attach()
292 SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), in acpi_tz_attach()
296 SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), in acpi_tz_attach()
298 &sc->tz_zone.ac, sizeof(sc->tz_zone.ac), sysctl_handle_opaque, "IK", in acpi_tz_attach()
300 SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), in acpi_tz_attach()
303 "I", "thermal constant 1 for passive cooling"); in acpi_tz_attach()
304 SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), in acpi_tz_attach()
307 "I", "thermal constant 2 for passive cooling"); in acpi_tz_attach()
308 SYSCTL_ADD_PROC(&sc->tz_sysctl_ctx, SYSCTL_CHILDREN(sc->tz_sysctl_tree), in acpi_tz_attach()
311 "I", "thermal sampling period for passive cooling"); in acpi_tz_attach()
316 sc->tz_event = EVENTHANDLER_REGISTER(power_profile_change, in acpi_tz_attach()
325 sc->tz_flags |= TZ_FLAG_GETPROFILE; in acpi_tz_attach()
349 printf("acpi_tz: could not create thread - %d", error); in acpi_tz_startup()
352 * Create a thread to handle passive cooling for 1st zone which in acpi_tz_startup()
364 sc->tz_cooling_enabled = TRUE; in acpi_tz_startup()
367 sc->tz_cooling_enabled = FALSE; in acpi_tz_startup()
394 if (sc->tz_zone.al[i].Pointer != NULL) in acpi_tz_establish()
395 AcpiOsFree(sc->tz_zone.al[i].Pointer); in acpi_tz_establish()
396 if (sc->tz_zone.psl.Pointer != NULL) in acpi_tz_establish()
397 AcpiOsFree(sc->tz_zone.psl.Pointer); in acpi_tz_establish()
401 * with passive cooling thread which refers psv, tc1, tc2 and tsp. in acpi_tz_establish()
403 bzero(sc->tz_zone.ac, sizeof(sc->tz_zone.ac)); in acpi_tz_establish()
404 bzero(sc->tz_zone.al, sizeof(sc->tz_zone.al)); in acpi_tz_establish()
405 bzero(&sc->tz_zone.psl, sizeof(sc->tz_zone.psl)); in acpi_tz_establish()
410 acpi_tz_getparam(sc, nbuf, &sc->tz_zone.ac[i]); in acpi_tz_establish()
412 sc->tz_zone.al[i].Length = ACPI_ALLOCATE_BUFFER; in acpi_tz_establish()
413 sc->tz_zone.al[i].Pointer = NULL; in acpi_tz_establish()
414 AcpiEvaluateObject(sc->tz_handle, nbuf, NULL, &sc->tz_zone.al[i]); in acpi_tz_establish()
415 obj = (ACPI_OBJECT *)sc->tz_zone.al[i].Pointer; in acpi_tz_establish()
418 if (obj->Type != ACPI_TYPE_PACKAGE) { in acpi_tz_establish()
419 device_printf(sc->tz_dev, "%s has unknown type %d, rejecting\n", in acpi_tz_establish()
420 nbuf, obj->Type); in acpi_tz_establish()
425 acpi_tz_getparam(sc, "_CRT", &sc->tz_zone.crt); in acpi_tz_establish()
426 acpi_tz_getparam(sc, "_HOT", &sc->tz_zone.hot); in acpi_tz_establish()
427 acpi_tz_getparam(sc, "_CR3", &sc->tz_zone.cr3); in acpi_tz_establish()
428 sc->tz_zone.psl.Length = ACPI_ALLOCATE_BUFFER; in acpi_tz_establish()
429 sc->tz_zone.psl.Pointer = NULL; in acpi_tz_establish()
430 AcpiEvaluateObject(sc->tz_handle, "_PSL", NULL, &sc->tz_zone.psl); in acpi_tz_establish()
431 acpi_tz_getparam(sc, "_PSV", &sc->tz_zone.psv); in acpi_tz_establish()
432 acpi_tz_getparam(sc, "_TC1", &sc->tz_zone.tc1); in acpi_tz_establish()
433 acpi_tz_getparam(sc, "_TC2", &sc->tz_zone.tc2); in acpi_tz_establish()
434 acpi_tz_getparam(sc, "_TSP", &sc->tz_zone.tsp); in acpi_tz_establish()
435 acpi_tz_getparam(sc, "_TZP", &sc->tz_zone.tzp); in acpi_tz_establish()
438 * Sanity-check the values we've been given. in acpi_tz_establish()
443 acpi_tz_sanity(sc, &sc->tz_zone.crt, "_CRT"); in acpi_tz_establish()
444 acpi_tz_sanity(sc, &sc->tz_zone.hot, "_HOT"); in acpi_tz_establish()
445 acpi_tz_sanity(sc, &sc->tz_zone.cr3, "_CR3"); in acpi_tz_establish()
446 acpi_tz_sanity(sc, &sc->tz_zone.psv, "_PSV"); in acpi_tz_establish()
448 acpi_tz_sanity(sc, &sc->tz_zone.ac[i], "_ACx"); in acpi_tz_establish()
461 if (active < -1 || active >= TZ_NUMLEVELS) in acpi_tz_aclevel_string()
479 status = acpi_GetInteger(sc->tz_handle, acpi_tz_tmp_name, &temp); in acpi_tz_get_temperature()
481 ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev), in acpi_tz_get_temperature()
482 "error fetching current temperature -- %s\n", in acpi_tz_get_temperature()
489 if (temp == -1) in acpi_tz_get_temperature()
493 sc->tz_temperature = temp; in acpi_tz_get_temperature()
516 /* XXX disable zone? go to max cooling? */ in acpi_tz_monitor()
519 temp = sc->tz_temperature; in acpi_tz_monitor()
524 * Note that the _ACx levels sort from hot to cold. in acpi_tz_monitor()
527 for (i = TZ_NUMLEVELS - 1; i >= 0; i--) { in acpi_tz_monitor()
528 if (sc->tz_zone.ac[i] != -1 && temp >= sc->tz_zone.ac[i]) in acpi_tz_monitor()
534 * minimum cooling run time if requested. in acpi_tz_monitor()
536 if (acpi_tz_min_runtime > 0 && sc->tz_active != TZ_ACTIVE_NONE && in acpi_tz_monitor()
537 sc->tz_active != TZ_ACTIVE_UNKNOWN && in acpi_tz_monitor()
538 (newactive == TZ_ACTIVE_NONE || newactive > sc->tz_active)) { in acpi_tz_monitor()
540 timespecsub(&curtime, &sc->tz_cooling_started, &curtime); in acpi_tz_monitor()
542 newactive = sc->tz_active; in acpi_tz_monitor()
546 if (sc->tz_requested != TZ_ACTIVE_NONE && (newactive == TZ_ACTIVE_NONE in acpi_tz_monitor()
547 || sc->tz_requested < newactive)) in acpi_tz_monitor()
548 newactive = sc->tz_requested; in acpi_tz_monitor()
550 /* update temperature-related flags */ in acpi_tz_monitor()
552 if (sc->tz_zone.psv != -1 && temp >= sc->tz_zone.psv) in acpi_tz_monitor()
554 if (sc->tz_zone.cr3 != -1 && temp >= sc->tz_zone.cr3) in acpi_tz_monitor()
556 if (sc->tz_zone.hot != -1 && temp >= sc->tz_zone.hot) in acpi_tz_monitor()
558 if (sc->tz_zone.crt != -1 && temp >= sc->tz_zone.crt) in acpi_tz_monitor()
561 /* If the active cooling state has changed, we have to switch things. */ in acpi_tz_monitor()
562 if (sc->tz_active == TZ_ACTIVE_UNKNOWN) { in acpi_tz_monitor()
564 * We don't know which cooling device is on or off, in acpi_tz_monitor()
569 if (sc->tz_zone.al[i].Pointer != NULL) { in acpi_tz_monitor()
571 (ACPI_OBJECT *)sc->tz_zone.al[i].Pointer, in acpi_tz_monitor()
576 sc->tz_active = TZ_ACTIVE_NONE; in acpi_tz_monitor()
579 if (newactive != sc->tz_active) { in acpi_tz_monitor()
580 /* Turn off unneeded cooling devices that are on, if any are */ in acpi_tz_monitor()
581 for (i = TZ_ACTIVE_LEVEL(sc->tz_active); in acpi_tz_monitor()
584 (ACPI_OBJECT *)sc->tz_zone.al[i].Pointer, in acpi_tz_monitor()
587 /* Turn on cooling devices that are required, if any are */ in acpi_tz_monitor()
588 for (i = TZ_ACTIVE_LEVEL(sc->tz_active) - 1; in acpi_tz_monitor()
589 i >= TZ_ACTIVE_LEVEL(newactive); i--) { in acpi_tz_monitor()
591 (ACPI_OBJECT *)sc->tz_zone.al[i].Pointer, in acpi_tz_monitor()
595 ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev), in acpi_tz_monitor()
597 acpi_tz_aclevel_string(sc->tz_active), in acpi_tz_monitor()
599 sc->tz_active = newactive; in acpi_tz_monitor()
600 getnanotime(&sc->tz_cooling_started); in acpi_tz_monitor()
603 /* XXX (de)activate any passive cooling that may be required. */ in acpi_tz_monitor()
616 sc->tz_validchecks++; in acpi_tz_monitor()
617 if (sc->tz_validchecks == TZ_VALIDCHECKS) { in acpi_tz_monitor()
618 device_printf(sc->tz_dev, in acpi_tz_monitor()
619 "WARNING - current temperature (%d.%dC) exceeds safe limits\n", in acpi_tz_monitor()
620 TZ_KELVTOC(sc->tz_temperature)); in acpi_tz_monitor()
624 acpi_sc = acpi_device_get_parent_softc(sc->tz_dev); in acpi_tz_monitor()
627 } else if (sc->tz_validchecks == TZ_NOTIFYCOUNT) in acpi_tz_monitor()
628 acpi_UserNotify("Thermal", sc->tz_handle, TZ_NOTIFY_CRITICAL); in acpi_tz_monitor()
630 sc->tz_validchecks = 0; in acpi_tz_monitor()
632 sc->tz_thflags = newflags; in acpi_tz_monitor()
686 ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev), in acpi_tz_switch_cooler_on()
687 "failed to activate %s - %s\n", acpi_name(cooler), in acpi_tz_switch_cooler_on()
695 * Read/debug-print a parameter, default it to -1.
703 if (ACPI_FAILURE(acpi_GetInteger(sc->tz_handle, node, data))) { in acpi_tz_getparam()
704 *data = -1; in acpi_tz_getparam()
707 acpi_name(sc->tz_handle), node, *data)); in acpi_tz_getparam()
714 * Sanity-check a temperature value. Assume that setpoints
720 if (*val != -1 && (*val < TZ_ZEROC || *val > TZ_ZEROC + 2000)) { in acpi_tz_sanity()
729 if (what != acpi_tz_tmp_name || !sc->tz_insane_tmp_notified) { in acpi_tz_sanity()
730 device_printf(sc->tz_dev, "%s value is absurd, ignored (%d.%dC)\n", in acpi_tz_sanity()
735 sc->tz_insane_tmp_notified = 1; in acpi_tz_sanity()
737 *val = -1; in acpi_tz_sanity()
743 sc->tz_insane_tmp_notified = 0; in acpi_tz_sanity()
756 sc = (struct acpi_tz_softc *)oidp->oid_arg1; in acpi_tz_active_sysctl()
757 active = sc->tz_active; in acpi_tz_active_sysctl()
761 if (error != 0 || req->newptr == NULL) in acpi_tz_active_sysctl()
763 if (active < -1 || active >= TZ_NUMLEVELS) in acpi_tz_active_sysctl()
766 /* Set new preferred level and re-switch */ in acpi_tz_active_sysctl()
767 sc->tz_requested = active; in acpi_tz_active_sysctl()
778 sc = (struct acpi_tz_softc *)oidp->oid_arg1; in acpi_tz_cooling_sysctl()
779 enabled = sc->tz_cooling_enabled; in acpi_tz_cooling_sysctl()
783 if (error != 0 || req->newptr == NULL) in acpi_tz_cooling_sysctl()
796 sc->tz_cooling_enabled = enabled; in acpi_tz_cooling_sysctl()
807 sc = oidp->oid_arg1; in acpi_tz_temp_sysctl()
808 temp_ptr = (int *)(void *)(uintptr_t)((uintptr_t)sc + oidp->oid_arg2); in acpi_tz_temp_sysctl()
813 if (error != 0 || req->newptr == NULL) in acpi_tz_temp_sysctl()
820 /* Check user-supplied value for sanity. */ in acpi_tz_temp_sysctl()
821 acpi_tz_sanity(sc, &temp, "user-supplied temp"); in acpi_tz_temp_sysctl()
822 if (temp == -1) in acpi_tz_temp_sysctl()
836 sc = oidp->oid_arg1; in acpi_tz_passive_sysctl()
837 val_ptr = (int *)(void *)(uintptr_t)((uintptr_t)sc + oidp->oid_arg2); in acpi_tz_passive_sysctl()
842 if (error != 0 || req->newptr == NULL) in acpi_tz_passive_sysctl()
871 ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev), in acpi_tz_notify_handler()
885 sc->tz_flags |= flags; in acpi_tz_signal()
895 * acpi_tz_monitor() before evaluating changes to setpoints or the cooling
918 /* XXX passive cooling actions? */ in acpi_tz_timeout()
940 if ((sc->tz_flags & TZ_FLAG_NO_SCP) == 0) { in acpi_tz_power_profile()
942 status = acpi_SetInteger(sc->tz_handle, "_SCP", in acpi_tz_power_profile()
946 ACPI_VPRINT(sc->tz_dev, in acpi_tz_power_profile()
947 acpi_device_get_parent_softc(sc->tz_dev), in acpi_tz_power_profile()
948 "can't evaluate %s._SCP - %s\n", in acpi_tz_power_profile()
949 acpi_name(sc->tz_handle), in acpi_tz_power_profile()
951 sc->tz_flags |= TZ_FLAG_NO_SCP; in acpi_tz_power_profile()
953 /* We have to re-evaluate the entire zone now */ in acpi_tz_power_profile()
979 /* If the number of devices has changed, re-evaluate. */ in acpi_tz_thread()
995 flags = sc[i]->tz_flags; in acpi_tz_thread()
996 sc[i]->tz_flags &= TZ_FLAG_NO_SCP; in acpi_tz_thread()
1004 if (sc[i]->tz_flags & ~TZ_FLAG_NO_SCP) in acpi_tz_thread()
1027 if (!sc->tz_cooling_updated) in acpi_tz_cpufreq_restore()
1031 ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev), in acpi_tz_cpufreq_restore()
1033 TZ_KELVTOC(sc->tz_temperature), sc->tz_cooling_saved_freq); in acpi_tz_cpufreq_restore()
1036 sc->tz_cooling_updated = FALSE; in acpi_tz_cpufreq_restore()
1044 struct cf_level *levels; in acpi_tz_cpufreq_update() local
1047 levels = malloc(CPUFREQ_MAX_LEVELS * sizeof(*levels), M_TEMP, M_NOWAIT); in acpi_tz_cpufreq_update()
1048 if (levels == NULL) in acpi_tz_cpufreq_update()
1061 error = CPUFREQ_GET(dev, &levels[0]); in acpi_tz_cpufreq_update()
1064 freq = levels[0].total_set.freq; in acpi_tz_cpufreq_update()
1066 /* Get the current available frequency levels. */ in acpi_tz_cpufreq_update()
1068 error = CPUFREQ_LEVELS(dev, levels, &num_levels); in acpi_tz_cpufreq_update()
1076 perf = 100 * freq / levels[0].total_set.freq - req; in acpi_tz_cpufreq_update()
1081 desired_freq = levels[0].total_set.freq * perf / 100; in acpi_tz_cpufreq_update()
1086 if (levels[i].total_set.freq <= desired_freq) in acpi_tz_cpufreq_update()
1091 i--; in acpi_tz_cpufreq_update()
1094 if (!sc->tz_cooling_updated) { in acpi_tz_cpufreq_update()
1095 sc->tz_cooling_active = FALSE; in acpi_tz_cpufreq_update()
1100 if (desired_freq > sc->tz_cooling_saved_freq) in acpi_tz_cpufreq_update()
1101 desired_freq = sc->tz_cooling_saved_freq; in acpi_tz_cpufreq_update()
1104 for (i = num_levels - 1; i >= 0; i--) in acpi_tz_cpufreq_update()
1105 if (levels[i].total_set.freq >= desired_freq) in acpi_tz_cpufreq_update()
1109 if (i == -1) in acpi_tz_cpufreq_update()
1113 if (i == 0 || desired_freq == sc->tz_cooling_saved_freq) { in acpi_tz_cpufreq_update()
1116 sc->tz_cooling_active = FALSE; in acpi_tz_cpufreq_update()
1122 if (levels[i].total_set.freq != freq) { in acpi_tz_cpufreq_update()
1123 ACPI_VPRINT(sc->tz_dev, acpi_device_get_parent_softc(sc->tz_dev), in acpi_tz_cpufreq_update()
1126 TZ_KELVTOC(sc->tz_temperature), in acpi_tz_cpufreq_update()
1127 (freq > levels[i].total_set.freq) ? "de" : "in", in acpi_tz_cpufreq_update()
1128 freq, levels[i].total_set.freq); in acpi_tz_cpufreq_update()
1129 error = CPUFREQ_SET(dev, &levels[i], CPUFREQ_PRIO_KERN); in acpi_tz_cpufreq_update()
1130 if (error == 0 && !sc->tz_cooling_updated) { in acpi_tz_cpufreq_update()
1131 sc->tz_cooling_saved_freq = freq; in acpi_tz_cpufreq_update()
1132 sc->tz_cooling_updated = TRUE; in acpi_tz_cpufreq_update()
1137 if (levels) in acpi_tz_cpufreq_update()
1138 free(levels, M_TEMP); in acpi_tz_cpufreq_update()
1143 * Passive cooling thread; monitors current temperature according to the
1144 * cooling interval and calculates whether to scale back CPU frequency.
1156 prev_temp = sc->tz_temperature; in acpi_tz_cooling_thread()
1157 while (sc->tz_cooling_enabled) { in acpi_tz_cooling_thread()
1158 if (sc->tz_cooling_active) in acpi_tz_cooling_thread()
1160 curr_temp = sc->tz_temperature; in acpi_tz_cooling_thread()
1161 if (curr_temp >= sc->tz_zone.psv) in acpi_tz_cooling_thread()
1162 sc->tz_cooling_active = TRUE; in acpi_tz_cooling_thread()
1163 if (sc->tz_cooling_active) { in acpi_tz_cooling_thread()
1164 perf = sc->tz_zone.tc1 * (curr_temp - prev_temp) + in acpi_tz_cooling_thread()
1165 sc->tz_zone.tc2 * (curr_temp - sc->tz_zone.psv); in acpi_tz_cooling_thread()
1173 * active, disable cooling. in acpi_tz_cooling_thread()
1176 device_printf(sc->tz_dev, in acpi_tz_cooling_thread()
1177 "failed to set new freq, disabling passive cooling\n"); in acpi_tz_cooling_thread()
1178 sc->tz_cooling_enabled = FALSE; in acpi_tz_cooling_thread()
1183 tsleep(&sc->tz_cooling_proc, PZERO, "cooling", in acpi_tz_cooling_thread()
1184 hz * sc->tz_zone.tsp / 10); in acpi_tz_cooling_thread()
1186 if (sc->tz_cooling_active) { in acpi_tz_cooling_thread()
1188 sc->tz_cooling_active = FALSE; in acpi_tz_cooling_thread()
1190 sc->tz_cooling_proc = NULL; in acpi_tz_cooling_thread()
1192 sc->tz_cooling_proc_running = FALSE; in acpi_tz_cooling_thread()
1198 * TODO: We ignore _PSL (list of cooling devices) since cpufreq enumerates
1200 * reference non-CPU devices so we may want to support it then.
1205 return (sc->tz_zone.tc1 != -1 && sc->tz_zone.tc2 != -1 && in acpi_tz_cooling_is_available()
1206 sc->tz_zone.tsp != -1 && sc->tz_zone.tsp != 0 && in acpi_tz_cooling_is_available()
1207 sc->tz_zone.psv != -1); in acpi_tz_cooling_is_available()
1216 if (sc->tz_cooling_proc_running) { in acpi_tz_cooling_thread_start()
1220 sc->tz_cooling_proc_running = TRUE; in acpi_tz_cooling_thread_start()
1223 if (sc->tz_cooling_proc == NULL) { in acpi_tz_cooling_thread_start()
1225 &sc->tz_cooling_proc, RFHIGHPID, 0, "acpi_cooling%d", in acpi_tz_cooling_thread_start()
1226 device_get_unit(sc->tz_dev)); in acpi_tz_cooling_thread_start()
1228 device_printf(sc->tz_dev, "could not create thread - %d", error); in acpi_tz_cooling_thread_start()
1230 sc->tz_cooling_proc_running = FALSE; in acpi_tz_cooling_thread_start()