• Home
  • Raw
  • Download

Lines Matching refs:therm

27 nvkm_therm_temp_get(struct nvkm_therm *therm)  in nvkm_therm_temp_get()  argument
29 if (therm->func->temp_get) in nvkm_therm_temp_get()
30 return therm->func->temp_get(therm); in nvkm_therm_temp_get()
35 nvkm_therm_update_trip(struct nvkm_therm *therm) in nvkm_therm_update_trip() argument
37 struct nvbios_therm_trip_point *trip = therm->fan->bios.trip, in nvkm_therm_update_trip()
39 *last_trip = therm->last_trip; in nvkm_therm_update_trip()
40 u8 temp = therm->func->temp_get(therm); in nvkm_therm_update_trip()
45 for (i = 0; i < therm->fan->bios.nr_fan_trip; i++) { in nvkm_therm_update_trip()
57 therm->last_trip = cur_trip; in nvkm_therm_update_trip()
60 therm->last_trip = NULL; in nvkm_therm_update_trip()
67 nvkm_therm_update_linear(struct nvkm_therm *therm) in nvkm_therm_update_linear() argument
69 u8 linear_min_temp = therm->fan->bios.linear_min_temp; in nvkm_therm_update_linear()
70 u8 linear_max_temp = therm->fan->bios.linear_max_temp; in nvkm_therm_update_linear()
71 u8 temp = therm->func->temp_get(therm); in nvkm_therm_update_linear()
76 return therm->fan->bios.min_duty; in nvkm_therm_update_linear()
78 return therm->fan->bios.max_duty; in nvkm_therm_update_linear()
82 duty *= (therm->fan->bios.max_duty - therm->fan->bios.min_duty); in nvkm_therm_update_linear()
84 duty += therm->fan->bios.min_duty; in nvkm_therm_update_linear()
89 nvkm_therm_update(struct nvkm_therm *therm, int mode) in nvkm_therm_update() argument
91 struct nvkm_subdev *subdev = &therm->subdev; in nvkm_therm_update()
98 spin_lock_irqsave(&therm->lock, flags); in nvkm_therm_update()
100 mode = therm->mode; in nvkm_therm_update()
101 therm->mode = mode; in nvkm_therm_update()
105 nvkm_timer_alarm_cancel(tmr, &therm->alarm); in nvkm_therm_update()
106 duty = nvkm_therm_fan_get(therm); in nvkm_therm_update()
112 switch(therm->fan->bios.fan_mode) { in nvkm_therm_update()
114 duty = nvkm_therm_update_trip(therm); in nvkm_therm_update()
117 duty = nvkm_therm_update_linear(therm); in nvkm_therm_update()
120 if (therm->cstate) in nvkm_therm_update()
121 duty = therm->cstate; in nvkm_therm_update()
129 nvkm_timer_alarm_cancel(tmr, &therm->alarm); in nvkm_therm_update()
134 nvkm_timer_alarm(tmr, 1000000000ULL, &therm->alarm); in nvkm_therm_update()
135 spin_unlock_irqrestore(&therm->lock, flags); in nvkm_therm_update()
139 nvkm_therm_fan_set(therm, immd, duty); in nvkm_therm_update()
144 nvkm_therm_cstate(struct nvkm_therm *therm, int fan, int dir) in nvkm_therm_cstate() argument
146 struct nvkm_subdev *subdev = &therm->subdev; in nvkm_therm_cstate()
147 if (!dir || (dir < 0 && fan < therm->cstate) || in nvkm_therm_cstate()
148 (dir > 0 && fan > therm->cstate)) { in nvkm_therm_cstate()
150 therm->cstate = fan; in nvkm_therm_cstate()
151 nvkm_therm_update(therm, -1); in nvkm_therm_cstate()
159 struct nvkm_therm *therm = in nvkm_therm_alarm() local
161 nvkm_therm_update(therm, -1); in nvkm_therm_alarm()
165 nvkm_therm_fan_mode(struct nvkm_therm *therm, int mode) in nvkm_therm_fan_mode() argument
167 struct nvkm_subdev *subdev = &therm->subdev; in nvkm_therm_fan_mode()
184 therm->func->temp_get(therm) < 0) in nvkm_therm_fan_mode()
187 if (therm->mode == mode) in nvkm_therm_fan_mode()
191 nvkm_therm_update(therm, mode); in nvkm_therm_fan_mode()
196 nvkm_therm_attr_get(struct nvkm_therm *therm, enum nvkm_therm_attr_type type) in nvkm_therm_attr_get() argument
200 return therm->fan->bios.min_duty; in nvkm_therm_attr_get()
202 return therm->fan->bios.max_duty; in nvkm_therm_attr_get()
204 return therm->mode; in nvkm_therm_attr_get()
206 return therm->bios_sensor.thrs_fan_boost.temp; in nvkm_therm_attr_get()
208 return therm->bios_sensor.thrs_fan_boost.hysteresis; in nvkm_therm_attr_get()
210 return therm->bios_sensor.thrs_down_clock.temp; in nvkm_therm_attr_get()
212 return therm->bios_sensor.thrs_down_clock.hysteresis; in nvkm_therm_attr_get()
214 return therm->bios_sensor.thrs_critical.temp; in nvkm_therm_attr_get()
216 return therm->bios_sensor.thrs_critical.hysteresis; in nvkm_therm_attr_get()
218 return therm->bios_sensor.thrs_shutdown.temp; in nvkm_therm_attr_get()
220 return therm->bios_sensor.thrs_shutdown.hysteresis; in nvkm_therm_attr_get()
227 nvkm_therm_attr_set(struct nvkm_therm *therm, in nvkm_therm_attr_set() argument
234 if (value > therm->fan->bios.max_duty) in nvkm_therm_attr_set()
235 value = therm->fan->bios.max_duty; in nvkm_therm_attr_set()
236 therm->fan->bios.min_duty = value; in nvkm_therm_attr_set()
241 if (value < therm->fan->bios.min_duty) in nvkm_therm_attr_set()
242 value = therm->fan->bios.min_duty; in nvkm_therm_attr_set()
243 therm->fan->bios.max_duty = value; in nvkm_therm_attr_set()
246 return nvkm_therm_fan_mode(therm, value); in nvkm_therm_attr_set()
248 therm->bios_sensor.thrs_fan_boost.temp = value; in nvkm_therm_attr_set()
249 therm->func->program_alarms(therm); in nvkm_therm_attr_set()
252 therm->bios_sensor.thrs_fan_boost.hysteresis = value; in nvkm_therm_attr_set()
253 therm->func->program_alarms(therm); in nvkm_therm_attr_set()
256 therm->bios_sensor.thrs_down_clock.temp = value; in nvkm_therm_attr_set()
257 therm->func->program_alarms(therm); in nvkm_therm_attr_set()
260 therm->bios_sensor.thrs_down_clock.hysteresis = value; in nvkm_therm_attr_set()
261 therm->func->program_alarms(therm); in nvkm_therm_attr_set()
264 therm->bios_sensor.thrs_critical.temp = value; in nvkm_therm_attr_set()
265 therm->func->program_alarms(therm); in nvkm_therm_attr_set()
268 therm->bios_sensor.thrs_critical.hysteresis = value; in nvkm_therm_attr_set()
269 therm->func->program_alarms(therm); in nvkm_therm_attr_set()
272 therm->bios_sensor.thrs_shutdown.temp = value; in nvkm_therm_attr_set()
273 therm->func->program_alarms(therm); in nvkm_therm_attr_set()
276 therm->bios_sensor.thrs_shutdown.hysteresis = value; in nvkm_therm_attr_set()
277 therm->func->program_alarms(therm); in nvkm_therm_attr_set()
287 struct nvkm_therm *therm = nvkm_therm(subdev); in nvkm_therm_intr() local
288 if (therm->func->intr) in nvkm_therm_intr()
289 therm->func->intr(therm); in nvkm_therm_intr()
295 struct nvkm_therm *therm = nvkm_therm(subdev); in nvkm_therm_fini() local
297 if (therm->func->fini) in nvkm_therm_fini()
298 therm->func->fini(therm); in nvkm_therm_fini()
300 nvkm_therm_fan_fini(therm, suspend); in nvkm_therm_fini()
301 nvkm_therm_sensor_fini(therm, suspend); in nvkm_therm_fini()
304 therm->suspend = therm->mode; in nvkm_therm_fini()
305 therm->mode = NVKM_THERM_CTRL_NONE; in nvkm_therm_fini()
314 struct nvkm_therm *therm = nvkm_therm(subdev); in nvkm_therm_oneinit() local
315 nvkm_therm_sensor_ctor(therm); in nvkm_therm_oneinit()
316 nvkm_therm_ic_ctor(therm); in nvkm_therm_oneinit()
317 nvkm_therm_fan_ctor(therm); in nvkm_therm_oneinit()
318 nvkm_therm_fan_mode(therm, NVKM_THERM_CTRL_AUTO); in nvkm_therm_oneinit()
319 nvkm_therm_sensor_preinit(therm); in nvkm_therm_oneinit()
326 struct nvkm_therm *therm = nvkm_therm(subdev); in nvkm_therm_init() local
328 therm->func->init(therm); in nvkm_therm_init()
330 if (therm->suspend >= 0) { in nvkm_therm_init()
332 if (therm->suspend > 0) in nvkm_therm_init()
333 nvkm_therm_fan_set(therm, true, therm->fan->percent); in nvkm_therm_init()
335 nvkm_therm_fan_mode(therm, therm->suspend); in nvkm_therm_init()
338 nvkm_therm_sensor_init(therm); in nvkm_therm_init()
339 nvkm_therm_fan_init(therm); in nvkm_therm_init()
346 struct nvkm_therm *therm = nvkm_therm(subdev); in nvkm_therm_dtor() local
347 kfree(therm->fan); in nvkm_therm_dtor()
348 return therm; in nvkm_therm_dtor()
364 struct nvkm_therm *therm; in nvkm_therm_new_() local
366 if (!(therm = *ptherm = kzalloc(sizeof(*therm), GFP_KERNEL))) in nvkm_therm_new_()
369 nvkm_subdev_ctor(&nvkm_therm, device, index, 0, &therm->subdev); in nvkm_therm_new_()
370 therm->func = func; in nvkm_therm_new_()
372 nvkm_alarm_init(&therm->alarm, nvkm_therm_alarm); in nvkm_therm_new_()
373 spin_lock_init(&therm->lock); in nvkm_therm_new_()
374 spin_lock_init(&therm->sensor.alarm_program_lock); in nvkm_therm_new_()
376 therm->fan_get = nvkm_therm_fan_user_get; in nvkm_therm_new_()
377 therm->fan_set = nvkm_therm_fan_user_set; in nvkm_therm_new_()
378 therm->attr_get = nvkm_therm_attr_get; in nvkm_therm_new_()
379 therm->attr_set = nvkm_therm_attr_set; in nvkm_therm_new_()
380 therm->mode = therm->suspend = -1; /* undefined */ in nvkm_therm_new_()