mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-08 15:40:34 -04:00
power: Replace LenovoWmiTdpLimiter with FirmwareAttributeTdpLimiter
It seems several devices use a firmware-attribute interface to do TDP limiting. This turns LenovoWmiTdpLimiter into a generic interface that can be configured to use an arbitrary firmware-attribute name and check for an arbitrary power profile.
This commit is contained in:
parent
a67e911aa7
commit
4eeffda8ef
4 changed files with 223 additions and 24 deletions
|
@ -118,6 +118,12 @@ pub(crate) struct BatteryChargeLimitConfig {
|
|||
pub attribute: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Debug)]
|
||||
pub(crate) struct FirmwareAttributeConfig {
|
||||
pub attribute: String,
|
||||
pub performance_profile: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize, Debug)]
|
||||
pub(crate) struct PerformanceProfileConfig {
|
||||
pub suggested_default: String,
|
||||
|
@ -130,6 +136,7 @@ pub(crate) struct TdpLimitConfig {
|
|||
pub method: TdpLimitingMethod,
|
||||
pub range: Option<RangeConfig<u32>>,
|
||||
pub download_mode_limit: Option<NonZeroU32>,
|
||||
pub firmware_attribute: Option<FirmwareAttributeConfig>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Default, Deserialize, Debug)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue