mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Fix fan controls on z13
This commit is contained in:
@@ -181,15 +181,29 @@ impl FanCurveProfiles {
|
||||
PlatformProfile::Quiet | PlatformProfile::LowPower => &mut self.quiet,
|
||||
PlatformProfile::Custom => &mut self.custom,
|
||||
};
|
||||
for fan in fans.iter().filter(|f| !f.enabled) {
|
||||
debug!("write_profile_curve_to_platform: writing profile:{profile}, {fan:?}");
|
||||
|
||||
// First write all curve data (pwm/temp values) for all fans
|
||||
for fan in fans.iter() {
|
||||
debug!("write_profile_curve_to_platform: writing curve data for profile:{profile}, {fan:?}");
|
||||
fan.write_to_device(device)?;
|
||||
}
|
||||
// Write enabled fans last because the kernel currently resets *all* if one is
|
||||
// disabled
|
||||
|
||||
// Then set enables: disabled fans first, then enabled fans last.
|
||||
// This order is important because on some devices (e.g., ASUS Z13 2025)
|
||||
// setting any pwm_enable to 2 (disabled) resets ALL fan enables.
|
||||
for fan in fans.iter().filter(|f| !f.enabled) {
|
||||
debug!(
|
||||
"write_profile_curve_to_platform: disabling fan for profile:{profile}, {:?}",
|
||||
fan.fan
|
||||
);
|
||||
fan.set_enable(device)?;
|
||||
}
|
||||
for fan in fans.iter().filter(|f| f.enabled) {
|
||||
debug!("write_profile_curve_to_platform: writing profile:{profile}, {fan:?}");
|
||||
fan.write_to_device(device)?;
|
||||
debug!(
|
||||
"write_profile_curve_to_platform: enabling fan for profile:{profile}, {:?}",
|
||||
fan.fan
|
||||
);
|
||||
fan.set_enable(device)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user