Lines Matching +full:full +full:- +full:hd

1 // SPDX-License-Identifier: GPL-2.0-only
11 * that none of the code has been re-used, it's a complete re-implementation
24 * - the linked control (second control) gets the target value as-is
26 * - the main control (first control) gets the target value scaled with
28 * - the value of the target of the CPU Fan control loop is retrieved,
33 * controls : system-fan, drive-bay-fan
34 * sensors : hd-temp
41 * linear-factors : offset = 0xff38 scale = 0x0ccd
45 * controls : system-fan, drive-bay-fan
46 * sensors : hd-temp
53 * linear-factors : offset = 0xff38 scale = 0x0ccd
57 * controls : system-fan
58 * sensors : hd-temp
65 * linear-factors : offset = 0x0000 scale = 0x1000
74 * controls : cpu-fan
75 * sensors : cpu-temp cpu-power
77 * linear-factors : offset = 0xfb50 scale = 0x1000
292 wf_smu_sys_fans->ticks = 1; in wf_smu_create_sys_fans()
293 wf_smu_sys_fans->scale0 = param->scale0; in wf_smu_create_sys_fans()
294 wf_smu_sys_fans->offset0 = param->offset0; in wf_smu_create_sys_fans()
295 wf_smu_sys_fans->scale1 = param->scale1; in wf_smu_create_sys_fans()
296 wf_smu_sys_fans->offset1 = param->offset1; in wf_smu_create_sys_fans()
299 pid_param.gd = param->gd; in wf_smu_create_sys_fans()
300 pid_param.gp = param->gp; in wf_smu_create_sys_fans()
301 pid_param.gr = param->gr; in wf_smu_create_sys_fans()
304 pid_param.itarget = param->itarget; in wf_smu_create_sys_fans()
313 wf_pid_init(&wf_smu_sys_fans->pid, &pid_param); in wf_smu_create_sys_fans()
333 if (--st->ticks != 0) { in wf_smu_sys_fans_tick()
338 st->ticks = WF_SMU_SYS_FANS_INTERVAL; in wf_smu_sys_fans_tick()
342 printk(KERN_WARNING "windfarm: HD temp sensor error %d\n", in wf_smu_sys_fans_tick()
348 DBG("wf_smu: System Fans tick ! HD temp: %d.%03d\n", in wf_smu_sys_fans_tick()
351 if (temp > (st->pid.param.itarget + 0x50000)) in wf_smu_sys_fans_tick()
354 new_setpoint = wf_pid_run(&st->pid, temp); in wf_smu_sys_fans_tick()
358 scaled = ((((s64)new_setpoint) * (s64)st->scale0) >> 12) + st->offset0; in wf_smu_sys_fans_tick()
362 cputarget = wf_smu_cpu_fans ? wf_smu_cpu_fans->pid.target : 0; in wf_smu_sys_fans_tick()
363 cputarget = ((((s64)cputarget) * (s64)st->scale1) >> 12) + st->offset1; in wf_smu_sys_fans_tick()
365 scaled = max(scaled, st->pid.param.min); in wf_smu_sys_fans_tick()
366 scaled = min(scaled, st->pid.param.max); in wf_smu_sys_fans_tick()
370 if (st->sys_setpoint == scaled && new_setpoint == st->hd_setpoint) in wf_smu_sys_fans_tick()
372 st->sys_setpoint = scaled; in wf_smu_sys_fans_tick()
373 st->hd_setpoint = new_setpoint; in wf_smu_sys_fans_tick()
376 rc = wf_control_set(fan_system, st->sys_setpoint); in wf_smu_sys_fans_tick()
384 rc = wf_control_set(fan_hd, st->hd_setpoint); in wf_smu_sys_fans_tick()
386 printk(KERN_WARNING "windfarm: HD fan error %d\n", in wf_smu_sys_fans_tick()
416 tmax = ((s32)fvt->maxtemp) << 16; in wf_smu_create_cpu_fans()
425 wf_smu_cpu_fans->ticks = 1; in wf_smu_create_cpu_fans()
427 wf_smu_cpu_fans->scale = WF_SMU_CPU_FANS_SIBLING_SCALE; in wf_smu_create_cpu_fans()
428 wf_smu_cpu_fans->offset = WF_SMU_CPU_FANS_SIBLING_OFFSET; in wf_smu_create_cpu_fans()
432 pid_param.history_len = piddata->history_len; in wf_smu_create_cpu_fans()
435 "CPU control loop (%d)\n", piddata->history_len); in wf_smu_create_cpu_fans()
438 pid_param.gd = piddata->gd; in wf_smu_create_cpu_fans()
439 pid_param.gp = piddata->gp; in wf_smu_create_cpu_fans()
440 pid_param.gr = piddata->gr / pid_param.history_len; in wf_smu_create_cpu_fans()
442 tdelta = ((s32)piddata->target_temp_delta) << 16; in wf_smu_create_cpu_fans()
443 maxpow = ((s32)piddata->max_power) << 16; in wf_smu_create_cpu_fans()
444 powadj = ((s32)piddata->power_adj) << 16; in wf_smu_create_cpu_fans()
447 pid_param.ttarget = tmax - tdelta; in wf_smu_create_cpu_fans()
448 pid_param.pmaxadj = maxpow - powadj; in wf_smu_create_cpu_fans()
453 wf_cpu_pid_init(&wf_smu_cpu_fans->pid, &pid_param); in wf_smu_create_cpu_fans()
477 if (--st->ticks != 0) { in wf_smu_cpu_fans_tick()
482 st->ticks = WF_SMU_CPU_FANS_INTERVAL; in wf_smu_cpu_fans_tick()
507 if (temp > st->pid.param.tmax) in wf_smu_cpu_fans_tick()
510 new_setpoint = wf_cpu_pid_run(&st->pid, power, temp); in wf_smu_cpu_fans_tick()
514 systarget = wf_smu_sys_fans ? wf_smu_sys_fans->pid.target : 0; in wf_smu_cpu_fans_tick()
515 systarget = ((((s64)systarget) * (s64)st->scale) >> 12) in wf_smu_cpu_fans_tick()
516 + st->offset; in wf_smu_cpu_fans_tick()
518 new_setpoint = max(new_setpoint, st->pid.param.min); in wf_smu_cpu_fans_tick()
519 new_setpoint = min(new_setpoint, st->pid.param.max); in wf_smu_cpu_fans_tick()
523 if (st->cpu_setpoint == new_setpoint) in wf_smu_cpu_fans_tick()
525 st->cpu_setpoint = new_setpoint; in wf_smu_cpu_fans_tick()
528 rc = wf_control_set(fan_cpu_main, st->cpu_setpoint); in wf_smu_cpu_fans_tick()
555 if (wf_smu_skipping && --wf_smu_skipping) in wf_smu_tick()
568 * fans to full speed. in wf_smu_tick()
616 if (fan_cpu_main == NULL && !strcmp(ct->name, "cpu-fan")) { in wf_smu_new_control()
621 if (fan_system == NULL && !strcmp(ct->name, "system-fan")) { in wf_smu_new_control()
626 if (cpufreq_clamp == NULL && !strcmp(ct->name, "cpufreq-clamp")) { in wf_smu_new_control()
631 /* Darwin property list says the HD fan is only for model ID in wf_smu_new_control()
641 if (fan_hd == NULL && !strcmp(ct->name, "drive-bay-fan")) { in wf_smu_new_control()
655 if (sensor_cpu_power == NULL && !strcmp(sr->name, "cpu-power")) { in wf_smu_new_sensor()
660 if (sensor_cpu_temp == NULL && !strcmp(sr->name, "cpu-temp")) { in wf_smu_new_sensor()
665 if (sensor_hd_temp == NULL && !strcmp(sr->name, "hd-temp")) { in wf_smu_new_sensor()
681 ((struct wf_control *)data)->name); in wf_smu_notify()
687 ((struct wf_sensor *)data)->name); in wf_smu_notify()
710 wf_smu_mach_model = st->model_id; in wf_init_pm()
778 int rc = -ENODEV; in wf_smu_init()