Advanced Aura feature

Groundwork for 'advanced' aura modes
Add single zone + Doom light flash
Fix mocking for ROGCC
Better prepare & change to mapping of keyboard layouts to models and functions
Refactor and begin using new key layout stuff
Enable first arg to rogcc to set layout in mocking feature mode
Complete refactor of key layouts, and to RON serde
This commit is contained in:
Luke D. Jones
2022-12-11 11:50:47 +13:00
parent e3ecaa92bd
commit 1cbffedaeb
134 changed files with 8249 additions and 4390 deletions

View File

@@ -1,14 +1,13 @@
use std::{fmt::Display, path::PathBuf, str::FromStr};
use std::fmt::Display;
use std::path::PathBuf;
use std::str::FromStr;
use log::{info, warn};
use serde::{Deserialize, Serialize};
use zbus::zvariant::Type;
use crate::{
attr_bool, attr_u8,
error::{PlatformError, Result},
to_device,
};
use crate::error::{PlatformError, Result};
use crate::{attr_bool, attr_u8, to_device};
/// The "platform" device provides access to things like:
/// - `dgpu_disable`
@@ -24,6 +23,21 @@ pub struct AsusPlatform {
}
impl AsusPlatform {
attr_bool!("dgpu_disable", path);
attr_bool!("egpu_enable", path);
attr_bool!("panel_od", path);
attr_bool!("gpu_mux_mode", path);
// This is technically the same as `platform_profile` since both are tied
// in-kernel
attr_u8!("throttle_thermal_policy", path);
// The acpi platform_profile support
attr_u8!("platform_profile", pp_path);
pub fn new() -> Result<Self> {
let mut enumerator = udev::Enumerator::new().map_err(|err| {
warn!("{}", err);
@@ -54,15 +68,6 @@ impl AsusPlatform {
"asus-nb-wmi not found".into(),
))
}
attr_bool!("dgpu_disable", path);
attr_bool!("egpu_enable", path);
attr_bool!("panel_od", path);
attr_bool!("gpu_mux_mode", path);
// This is technically the same as `platform_profile` since both are tied in-kernel
attr_u8!("throttle_thermal_policy", path);
// The acpi platform_profile support
attr_u8!("platform_profile", pp_path);
}
#[derive(Serialize, Deserialize, Default, Type, Debug, PartialEq, Eq, Clone, Copy)]