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