Skip to content

Commit 5de2557

Browse files
feat: add pwm1_min pwm1_max
1 parent 94cd569 commit 5de2557

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "amdgpu-sysfs"
3-
version = "0.18.0"
3+
version = "0.18.1"
44
authors = ["Ilya Zlobintsev <ilya.zl@protonmail.com>"]
55
edition = "2021"
66
license = "GPL-3.0"

src/hw_mon.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,18 @@ impl HwMon {
133133
pwm.parse().context("Unexpected PWM (driver bug?)")
134134
}
135135

136+
/// Gets the minimum pulse width modulation fan level.
137+
pub fn get_fan_min_pwm(&self) -> Result<u8> {
138+
let pwm = self.read_file("pwm1_min")?;
139+
pwm.parse().context("Unexpected PWM (driver bug?)")
140+
}
141+
142+
/// Gets the maximum pulse width modulation fan level.
143+
pub fn get_fan_max_pwm(&self) -> Result<u8> {
144+
let pwm = self.read_file("pwm1_max")?;
145+
pwm.parse().context("Unexpected PWM (driver bug?)")
146+
}
147+
136148
/// Sets the pulse width modulation fan level.
137149
pub fn set_fan_pwm(&self, pwm: u8) -> Result<()> {
138150
self.write_file("pwm1", pwm.to_string())

0 commit comments

Comments
 (0)