daemon: inotify for panel_od and gu_mux_mode

This commit is contained in:
Luke D. Jones
2022-09-21 19:04:28 +12:00
parent a44a1bfa89
commit 56285916cd
8 changed files with 73 additions and 15 deletions

View File

@@ -127,5 +127,6 @@ macro_rules! attr_u8_array {
crate::has_attr!($attr_name $item);
crate::get_attr_u8_array!($attr_name $item);
crate::set_attr_u8_array!($attr_name $item);
crate::watch_attr!($attr_name $item);
};
}

View File

@@ -1,4 +1,4 @@
use std::path::PathBuf;
use std::{path::PathBuf, str::FromStr};
use log::{info, warn};
use serde::{Deserialize, Serialize};
@@ -20,6 +20,7 @@ use crate::{
#[derive(Debug, PartialEq, PartialOrd, Clone)]
pub struct AsusPlatform {
path: PathBuf,
pp_path: PathBuf,
}
impl AsusPlatform {
@@ -44,6 +45,7 @@ impl AsusPlatform {
info!("Found platform support at {:?}", device.sysname());
return Ok(Self {
path: device.syspath().to_owned(),
pp_path: PathBuf::from_str("/sys/firmware/acpi").unwrap(),
});
}
Err(PlatformError::MissingFunction(
@@ -55,6 +57,10 @@ impl AsusPlatform {
attr_bool!("egpu_enable", path);
attr_bool!("panel_od", path);
attr_u8!("gpu_mux_mode", path);
attr_u8!("throttle_thermal_policy", path);
// The acpi platform_profile support
attr_u8!("platform_profile", pp_path);
}
#[derive(Serialize, Deserialize, Type, Debug, PartialEq, Clone, Copy)]