Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync fans based on temp instead of duty #477

Merged
merged 1 commit into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions src/board/system76/common/fan.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,18 +220,15 @@ static uint8_t fan_get_duty(const struct Fan *const fan, int16_t temp) {
}

void fan_update_duty(void) {
#if defined(FAN2_PWM) && !CONFIG_HAVE_DGPU
int16_t dgpu_temp = peci_temp;
#if CONFIG_HAVE_DGPU
int16_t sys_temp = MAX(peci_temp, dgpu_temp);
#else
int16_t sys_temp = peci_temp;
#endif

uint8_t fan1_duty = fan_get_duty(&FAN1, peci_temp);
uint8_t fan1_duty = fan_get_duty(&FAN1, sys_temp);
#ifdef FAN2_PWM
uint8_t fan2_duty = fan_get_duty(&FAN2, dgpu_temp);

#if SYNC_FANS != 0
fan1_duty = MAX(fan1_duty, fan2_duty);
fan2_duty = MAX(fan1_duty, fan2_duty);
#endif // SYNC_FANS
uint8_t fan2_duty = fan_get_duty(&FAN2, sys_temp);
#endif // FAN2_PWM

// set FAN1 duty
Expand Down
4 changes: 0 additions & 4 deletions src/board/system76/common/include/board/fan.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
#define SMOOTH_FANS 1 // default to fan smoothing
#endif

#ifndef SYNC_FANS
#define SYNC_FANS 1 // default to syncing fan speeds
#endif

#if SMOOTH_FANS != 0
#ifndef SMOOTH_FANS_UP
#define SMOOTH_FANS_UP 45 // default to ~11 seconds for full ramp-up
Expand Down
Loading