power: Add LowPowerMode1 service

Add a new service to limit the platform TDP while handles are still held. This
feature is currently limited to the Steam Deck.
This commit is contained in:
Vicki Pfau 2024-08-21 22:35:57 -07:00
parent e7d2d63ac8
commit 65a81cee47
10 changed files with 666 additions and 56 deletions

View file

@ -11,6 +11,7 @@ use nix::unistd::{access, AccessFlags};
use serde::de::Error;
use serde::{Deserialize, Deserializer};
use std::io::ErrorKind;
use std::num::NonZeroU32;
use std::os::unix::fs::MetadataExt;
use std::path::PathBuf;
use strum::VariantNames;
@ -128,6 +129,7 @@ pub(crate) struct TdpLimitConfig {
#[serde(deserialize_with = "de_tdp_limiter_method")]
pub method: TdpLimitingMethod,
pub range: Option<RangeConfig<u32>>,
pub download_mode_limit: Option<NonZeroU32>,
}
#[derive(Clone, Default, Deserialize, Debug)]