Fix the handling of of the kernel change from "quiet" to "low-power"

A coming kernel change will convert "quiet" to "low-power" due to how
platform_profile can now have multiple registered handlers.
(kernel 6.14 est)

Fixes #609
This commit is contained in:
Luke Jones
2025-02-14 19:38:02 +13:00
parent 2c006699f2
commit 4dd29952c8
13 changed files with 146 additions and 71 deletions

View File

@@ -154,6 +154,18 @@ macro_rules! get_attr_string {
};
}
#[macro_export]
macro_rules! get_attr_string_array {
($(#[$attr:meta])* $attr_name:literal $item:ident) => {
concat_idents::concat_idents!(fn_name = get_, $attr_name {
$(#[$attr])*
pub fn fn_name(&self) -> Result<Vec<PlatformProfile>> {
$crate::read_attr_string_array(&to_device(&self.$item)?, $attr_name)
}
});
};
}
#[macro_export]
macro_rules! set_attr_string {
($(#[$attr:meta])* $attr_name:literal $item:ident) => {
@@ -175,3 +187,12 @@ macro_rules! attr_string {
$crate::watch_attr!($attr_name $item);
};
}
#[macro_export]
macro_rules! attr_string_array {
($(#[$attr:meta])* $attr_name:literal, $item:ident) => {
$crate::has_attr!($attr_name $item);
$crate::get_attr_string_array!($attr_name $item);
$crate::watch_attr!($attr_name $item);
};
}