Lines Matching refs:therm

27 nvkm_therm_temp_set_defaults(struct nvkm_therm *therm)  in nvkm_therm_temp_set_defaults()  argument
29 therm->bios_sensor.offset_constant = 0; in nvkm_therm_temp_set_defaults()
31 therm->bios_sensor.thrs_fan_boost.temp = 90; in nvkm_therm_temp_set_defaults()
32 therm->bios_sensor.thrs_fan_boost.hysteresis = 3; in nvkm_therm_temp_set_defaults()
34 therm->bios_sensor.thrs_down_clock.temp = 95; in nvkm_therm_temp_set_defaults()
35 therm->bios_sensor.thrs_down_clock.hysteresis = 3; in nvkm_therm_temp_set_defaults()
37 therm->bios_sensor.thrs_critical.temp = 105; in nvkm_therm_temp_set_defaults()
38 therm->bios_sensor.thrs_critical.hysteresis = 5; in nvkm_therm_temp_set_defaults()
40 therm->bios_sensor.thrs_shutdown.temp = 135; in nvkm_therm_temp_set_defaults()
41 therm->bios_sensor.thrs_shutdown.hysteresis = 5; /*not that it matters */ in nvkm_therm_temp_set_defaults()
45 nvkm_therm_temp_safety_checks(struct nvkm_therm *therm) in nvkm_therm_temp_safety_checks() argument
47 struct nvbios_therm_sensor *s = &therm->bios_sensor; in nvkm_therm_temp_safety_checks()
58 nvkm_therm_sensor_set_threshold_state(struct nvkm_therm *therm, in nvkm_therm_sensor_set_threshold_state() argument
62 therm->sensor.alarm_state[thrs] = st; in nvkm_therm_sensor_set_threshold_state()
67 nvkm_therm_sensor_get_threshold_state(struct nvkm_therm *therm, in nvkm_therm_sensor_get_threshold_state() argument
70 return therm->sensor.alarm_state[thrs]; in nvkm_therm_sensor_get_threshold_state()
81 nvkm_therm_sensor_event(struct nvkm_therm *therm, enum nvkm_therm_thrs thrs, in nvkm_therm_sensor_event() argument
84 struct nvkm_subdev *subdev = &therm->subdev; in nvkm_therm_sensor_event()
89 int temperature = therm->func->temp_get(therm); in nvkm_therm_sensor_event()
106 nvkm_therm_fan_set(therm, true, 100); in nvkm_therm_sensor_event()
107 nvkm_therm_fan_mode(therm, NVKM_THERM_CTRL_AUTO); in nvkm_therm_sensor_event()
111 if (therm->emergency.downclock) in nvkm_therm_sensor_event()
112 therm->emergency.downclock(therm, active); in nvkm_therm_sensor_event()
115 if (therm->emergency.pause) in nvkm_therm_sensor_event()
116 therm->emergency.pause(therm, active); in nvkm_therm_sensor_event()
137 nvkm_therm_threshold_hyst_polling(struct nvkm_therm *therm, in nvkm_therm_threshold_hyst_polling() argument
143 int temp = therm->func->temp_get(therm); in nvkm_therm_threshold_hyst_polling()
145 prev_state = nvkm_therm_sensor_get_threshold_state(therm, thrs_name); in nvkm_therm_threshold_hyst_polling()
157 nvkm_therm_sensor_set_threshold_state(therm, thrs_name, new_state); in nvkm_therm_threshold_hyst_polling()
158 nvkm_therm_sensor_event(therm, thrs_name, direction); in nvkm_therm_threshold_hyst_polling()
164 struct nvkm_therm *therm = in alarm_timer_callback() local
166 struct nvbios_therm_sensor *sensor = &therm->bios_sensor; in alarm_timer_callback()
167 struct nvkm_timer *tmr = therm->subdev.device->timer; in alarm_timer_callback()
170 spin_lock_irqsave(&therm->sensor.alarm_program_lock, flags); in alarm_timer_callback()
172 nvkm_therm_threshold_hyst_polling(therm, &sensor->thrs_fan_boost, in alarm_timer_callback()
175 nvkm_therm_threshold_hyst_polling(therm, in alarm_timer_callback()
179 nvkm_therm_threshold_hyst_polling(therm, &sensor->thrs_critical, in alarm_timer_callback()
182 nvkm_therm_threshold_hyst_polling(therm, &sensor->thrs_shutdown, in alarm_timer_callback()
185 spin_unlock_irqrestore(&therm->sensor.alarm_program_lock, flags); in alarm_timer_callback()
188 if (therm->func->temp_get(therm) >= 0) in alarm_timer_callback()
193 nvkm_therm_program_alarms_polling(struct nvkm_therm *therm) in nvkm_therm_program_alarms_polling() argument
195 struct nvbios_therm_sensor *sensor = &therm->bios_sensor; in nvkm_therm_program_alarms_polling()
197 nvkm_debug(&therm->subdev, in nvkm_therm_program_alarms_polling()
208 alarm_timer_callback(&therm->sensor.therm_poll_alarm); in nvkm_therm_program_alarms_polling()
212 nvkm_therm_sensor_init(struct nvkm_therm *therm) in nvkm_therm_sensor_init() argument
214 therm->func->program_alarms(therm); in nvkm_therm_sensor_init()
219 nvkm_therm_sensor_fini(struct nvkm_therm *therm, bool suspend) in nvkm_therm_sensor_fini() argument
221 struct nvkm_timer *tmr = therm->subdev.device->timer; in nvkm_therm_sensor_fini()
223 nvkm_timer_alarm(tmr, 0, &therm->sensor.therm_poll_alarm); in nvkm_therm_sensor_fini()
228 nvkm_therm_sensor_preinit(struct nvkm_therm *therm) in nvkm_therm_sensor_preinit() argument
232 if (therm->func->temp_get(therm) < 0) in nvkm_therm_sensor_preinit()
235 nvkm_debug(&therm->subdev, "internal sensor: %s\n", sensor_avail); in nvkm_therm_sensor_preinit()
239 nvkm_therm_sensor_ctor(struct nvkm_therm *therm) in nvkm_therm_sensor_ctor() argument
241 struct nvkm_subdev *subdev = &therm->subdev; in nvkm_therm_sensor_ctor()
244 nvkm_alarm_init(&therm->sensor.therm_poll_alarm, alarm_timer_callback); in nvkm_therm_sensor_ctor()
246 nvkm_therm_temp_set_defaults(therm); in nvkm_therm_sensor_ctor()
248 &therm->bios_sensor)) in nvkm_therm_sensor_ctor()
250 nvkm_therm_temp_safety_checks(therm); in nvkm_therm_sensor_ctor()