Lines Matching +full:max +full:- +full:rpm
1 // SPDX-License-Identifier: GPL-2.0-only
11 * that none of the code has been re-used, it's a complete re-implementation
155 "max fan speed\n"); in wf_smu_create_cpu_fans()
166 tmax = ((s32)fvt->maxtemp) << 16; in wf_smu_create_cpu_fans()
175 wf_smu_cpu_fans->ticks = 1; in wf_smu_create_cpu_fans()
179 pid_param.history_len = piddata->history_len; in wf_smu_create_cpu_fans()
182 "CPU control loop (%d)\n", piddata->history_len); in wf_smu_create_cpu_fans()
185 pid_param.gd = piddata->gd; in wf_smu_create_cpu_fans()
186 pid_param.gp = piddata->gp; in wf_smu_create_cpu_fans()
187 pid_param.gr = piddata->gr / pid_param.history_len; in wf_smu_create_cpu_fans()
189 tdelta = ((s32)piddata->target_temp_delta) << 16; in wf_smu_create_cpu_fans()
190 maxpow = ((s32)piddata->max_power) << 16; in wf_smu_create_cpu_fans()
191 powadj = ((s32)piddata->power_adj) << 16; in wf_smu_create_cpu_fans()
194 pid_param.ttarget = tmax - tdelta; in wf_smu_create_cpu_fans()
195 pid_param.pmaxadj = maxpow - powadj; in wf_smu_create_cpu_fans()
198 pid_param.max = wf_control_get_max(fan_cpu_main); in wf_smu_create_cpu_fans()
200 wf_cpu_pid_init(&wf_smu_cpu_fans->pid, &pid_param); in wf_smu_create_cpu_fans()
203 DBG(" ttarget=%d.%03d, tmax=%d.%03d, min=%d RPM, max=%d RPM\n", in wf_smu_create_cpu_fans()
205 pid_param.min, pid_param.max); in wf_smu_create_cpu_fans()
211 "for this machine model, max fan speed\n"); in wf_smu_create_cpu_fans()
224 if (--st->ticks != 0) { in wf_smu_cpu_fans_tick()
229 st->ticks = WF_SMU_CPU_FANS_INTERVAL; in wf_smu_cpu_fans_tick()
254 if (temp > st->pid.param.tmax) in wf_smu_cpu_fans_tick()
257 new_setpoint = wf_cpu_pid_run(&st->pid, power, temp); in wf_smu_cpu_fans_tick()
259 DBG("wf_smu: new_setpoint: %d RPM\n", (int)new_setpoint); in wf_smu_cpu_fans_tick()
261 if (st->cpu_setpoint == new_setpoint) in wf_smu_cpu_fans_tick()
263 st->cpu_setpoint = new_setpoint; in wf_smu_cpu_fans_tick()
266 rc = wf_control_set(fan_cpu_main, st->cpu_setpoint); in wf_smu_cpu_fans_tick()
274 rc = wf_control_set(fan_cpu_second, st->cpu_setpoint); in wf_smu_cpu_fans_tick()
282 rc = wf_control_set(fan_cpu_third, st->cpu_setpoint); in wf_smu_cpu_fans_tick()
307 " max fan speed\n"); in wf_smu_create_drive_fans()
310 wf_smu_drive_fans->ticks = 1; in wf_smu_create_drive_fans()
313 param.additive = (fan_hd->type == WF_CONTROL_RPM_FAN); in wf_smu_create_drive_fans()
315 param.max = wf_control_get_max(fan_hd); in wf_smu_create_drive_fans()
316 wf_pid_init(&wf_smu_drive_fans->pid, ¶m); in wf_smu_create_drive_fans()
319 DBG(" itarged=%d.%03d, min=%d RPM, max=%d RPM\n", in wf_smu_create_drive_fans()
320 FIX32TOPRINT(param.itarget), param.min, param.max); in wf_smu_create_drive_fans()
333 if (--st->ticks != 0) { in wf_smu_drive_fans_tick()
338 st->ticks = st->pid.param.interval; in wf_smu_drive_fans_tick()
351 if (temp > (st->pid.param.itarget + 0x50000)) in wf_smu_drive_fans_tick()
354 new_setpoint = wf_pid_run(&st->pid, temp); in wf_smu_drive_fans_tick()
358 if (st->setpoint == new_setpoint) in wf_smu_drive_fans_tick()
360 st->setpoint = new_setpoint; in wf_smu_drive_fans_tick()
363 rc = wf_control_set(fan_hd, st->setpoint); in wf_smu_drive_fans_tick()
388 " max fan speed\n"); in wf_smu_create_slots_fans()
391 wf_smu_slots_fans->ticks = 1; in wf_smu_create_slots_fans()
394 param.additive = (fan_slots->type == WF_CONTROL_RPM_FAN); in wf_smu_create_slots_fans()
396 param.max = wf_control_get_max(fan_slots); in wf_smu_create_slots_fans()
397 wf_pid_init(&wf_smu_slots_fans->pid, ¶m); in wf_smu_create_slots_fans()
400 DBG(" itarged=%d.%03d, min=%d RPM, max=%d RPM\n", in wf_smu_create_slots_fans()
401 FIX32TOPRINT(param.itarget), param.min, param.max); in wf_smu_create_slots_fans()
414 if (--st->ticks != 0) { in wf_smu_slots_fans_tick()
419 st->ticks = st->pid.param.interval; in wf_smu_slots_fans_tick()
433 if (power > (st->pid.param.itarget + 0x50000)) in wf_smu_slots_fans_tick()
437 new_setpoint = wf_pid_run(&st->pid, power); in wf_smu_slots_fans_tick()
441 if (st->setpoint == new_setpoint) in wf_smu_slots_fans_tick()
443 st->setpoint = new_setpoint; in wf_smu_slots_fans_tick()
446 rc = wf_control_set(fan_slots, st->setpoint); in wf_smu_slots_fans_tick()
475 if (wf_smu_skipping && --wf_smu_skipping) in wf_smu_tick()
543 if (fan_cpu_main == NULL && !strcmp(ct->name, "cpu-rear-fan-0")) { in wf_smu_new_control()
548 if (fan_cpu_second == NULL && !strcmp(ct->name, "cpu-rear-fan-1")) { in wf_smu_new_control()
553 if (fan_cpu_third == NULL && !strcmp(ct->name, "cpu-front-fan-0")) { in wf_smu_new_control()
558 if (cpufreq_clamp == NULL && !strcmp(ct->name, "cpufreq-clamp")) { in wf_smu_new_control()
563 if (fan_hd == NULL && !strcmp(ct->name, "drive-bay-fan")) { in wf_smu_new_control()
568 if (fan_slots == NULL && !strcmp(ct->name, "slots-fan")) { in wf_smu_new_control()
583 if (sensor_cpu_power == NULL && !strcmp(sr->name, "cpu-power")) { in wf_smu_new_sensor()
588 if (sensor_cpu_temp == NULL && !strcmp(sr->name, "cpu-temp")) { in wf_smu_new_sensor()
593 if (sensor_hd_temp == NULL && !strcmp(sr->name, "hd-temp")) { in wf_smu_new_sensor()
598 if (sensor_slots_power == NULL && !strcmp(sr->name, "slots-power")) { in wf_smu_new_sensor()
615 ((struct wf_control *)data)->name); in wf_smu_notify()
621 ((struct wf_sensor *)data)->name); in wf_smu_notify()
707 int rc = -ENODEV; in wf_smu_init()