Lines Matching defs:therm

34 	struct nvkm_therm *therm = fan->parent;
35 struct nvkm_subdev *subdev = &therm->subdev;
53 duty = fan->get(therm);
74 ret = fan->set(therm, duty);
112 nvkm_therm_fan_get(struct nvkm_therm *therm)
114 return therm->fan->get(therm);
118 nvkm_therm_fan_set(struct nvkm_therm *therm, bool immediate, int percent)
120 return nvkm_fan_update(therm->fan, immediate, percent);
124 nvkm_therm_fan_sense(struct nvkm_therm *therm)
126 struct nvkm_device *device = therm->subdev.device;
132 if (therm->func->fan_sense)
133 return therm->func->fan_sense(therm);
135 if (therm->fan->tach.func == DCB_GPIO_UNUSED)
143 prev = nvkm_gpio_get(gpio, 0, therm->fan->tach.func,
144 therm->fan->tach.line);
149 cur = nvkm_gpio_get(gpio, 0, therm->fan->tach.func,
150 therm->fan->tach.line);
169 nvkm_therm_fan_user_get(struct nvkm_therm *therm)
171 return nvkm_therm_fan_get(therm);
175 nvkm_therm_fan_user_set(struct nvkm_therm *therm, int percent)
177 if (therm->mode != NVKM_THERM_CTRL_MANUAL)
180 return nvkm_therm_fan_set(therm, true, percent);
184 nvkm_therm_fan_set_defaults(struct nvkm_therm *therm)
186 therm->fan->bios.pwm_freq = 0;
187 therm->fan->bios.min_duty = 0;
188 therm->fan->bios.max_duty = 100;
189 therm->fan->bios.bump_period = 500;
190 therm->fan->bios.slow_down_period = 2000;
191 therm->fan->bios.linear_min_temp = 40;
192 therm->fan->bios.linear_max_temp = 85;
196 nvkm_therm_fan_safety_checks(struct nvkm_therm *therm)
198 if (therm->fan->bios.min_duty > 100)
199 therm->fan->bios.min_duty = 100;
200 if (therm->fan->bios.max_duty > 100)
201 therm->fan->bios.max_duty = 100;
203 if (therm->fan->bios.min_duty > therm->fan->bios.max_duty)
204 therm->fan->bios.min_duty = therm->fan->bios.max_duty;
208 nvkm_therm_fan_init(struct nvkm_therm *therm)
214 nvkm_therm_fan_fini(struct nvkm_therm *therm, bool suspend)
216 struct nvkm_timer *tmr = therm->subdev.device->timer;
218 nvkm_timer_alarm(tmr, 0, &therm->fan->alarm);
223 nvkm_therm_fan_ctor(struct nvkm_therm *therm)
225 struct nvkm_subdev *subdev = &therm->subdev;
240 ret = nvkm_fanpwm_create(therm, &func);
242 ret = nvkm_fantog_create(therm, &func);
248 ret = nvkm_fannil_create(therm);
253 nvkm_debug(subdev, "FAN control: %s\n", therm->fan->type);
256 therm->fan->percent = nvkm_therm_fan_get(therm);
260 &therm->fan->tach);
262 therm->fan->tach.func = DCB_GPIO_UNUSED;
265 therm->fan->parent = therm;
266 nvkm_alarm_init(&therm->fan->alarm, nvkm_fan_alarm);
267 spin_lock_init(&therm->fan->lock);
270 nvkm_therm_fan_set_defaults(therm);
271 nvbios_perf_fan_parse(bios, &therm->fan->perf);
272 if (!nvbios_fan_parse(bios, &therm->fan->bios)) {
274 if (nvbios_therm_fan_parse(bios, &therm->fan->bios))
277 nvkm_therm_fan_safety_checks(therm);