Skip to content

Commit e00dbad

Browse files
draeathjackpot51
authored andcommitted
add fan curve support parity with Linux daemon
fan curves and model strings current as-of: https://github.com/pop-os/system76-power/blob/79b02d/src/fan.rs bump to rust 1.53 (or newer is OK) This is due to the use of "or patterns" inside a match. This was stabilized in rust 1.53: rust-lang/rust#79278 I see similar syntax used in the Linux daemon, but that uses rust 1.41... I'm uncertain how that was building previously?
1 parent 264b41a commit e00dbad

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.50.0
1+
1.53.0

src/main.rs

+13
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,19 @@ fn driver() -> io::Result<()> {
9090
debug!("{} {} uses standard fan curve", sys_vendor, product_version);
9191
FanCurve::standard()
9292
},
93+
("System76", "thelio-major-r1") => {
94+
debug!("{} {} uses threadripper2 fan curve", sys_vendor, product_version);
95+
FanCurve::threadripper2()
96+
},
97+
("System76", "thelio-major-r2" | "thelio-major-r2.1" | "thelio-major-b1" | "thelio-major-b2"
98+
| "thelio-major-b3" | "thelio-mega-r1" | "thelio-mega-r1.1" ) => {
99+
debug!("{} {} uses hedt fan curve", sys_vendor, product_version);
100+
FanCurve::hedt()
101+
},
102+
("System76", "thelio-massive-b1") => {
103+
debug!("{} {} uses xeon fan curve", sys_vendor, product_version);
104+
FanCurve::xeon()
105+
},
93106
_ => return Err(io::Error::new(
94107
io::ErrorKind::Other,
95108
format!(

0 commit comments

Comments
 (0)