Compare commits

..

1 Commits

Author SHA1 Message Date
James Lademann 42fda1d9c7 Merge branch 'Support_additional_ga403_2025' into 'main'
Add slash support for additional ga403 2025 models

See merge request asus-linux/asusctl!238
2025-12-18 19:37:35 +00:00
2 changed files with 35 additions and 44 deletions
+25 -31
View File
@@ -12,13 +12,12 @@ use crate::usb::{PROD_ID1, PROD_ID1_STR, PROD_ID2, PROD_ID2_STR};
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)] #[derive(Default, Debug, Copy, Clone, PartialEq, Eq, Deserialize, Serialize)]
pub enum SlashType { pub enum SlashType {
GA403_2024, GA403,
GA403_2025, GA403_2025,
GA605_2024, GA605,
GA605_2025, GU605,
GU605_2024, GU605C,
GU605_2025, G614F,
G614_2025,
#[default] #[default]
Unsupported, Unsupported,
} }
@@ -27,12 +26,11 @@ impl SlashType {
pub const fn prod_id(&self) -> u16 { pub const fn prod_id(&self) -> u16 {
match self { match self {
SlashType::GA403_2025 => PROD_ID2, SlashType::GA403_2025 => PROD_ID2,
SlashType::GA403_2024 => PROD_ID1, SlashType::GA403 => PROD_ID1,
SlashType::GA605_2025 => PROD_ID2, SlashType::GA605 => PROD_ID2,
SlashType::GA605_2024 => PROD_ID2, SlashType::GU605 => PROD_ID1,
SlashType::GU605_2025 => PROD_ID2, SlashType::GU605C => PROD_ID2,
SlashType::GU605_2024 => PROD_ID1, SlashType::G614F => PROD_ID2,
SlashType::G614_2025 => PROD_ID2,
SlashType::Unsupported => 0, SlashType::Unsupported => 0,
} }
} }
@@ -40,12 +38,11 @@ impl SlashType {
pub const fn prod_id_str(&self) -> &str { pub const fn prod_id_str(&self) -> &str {
match self { match self {
SlashType::GA403_2025 => PROD_ID2_STR, SlashType::GA403_2025 => PROD_ID2_STR,
SlashType::GA403_2024 => PROD_ID1_STR, SlashType::GA403 => PROD_ID1_STR,
SlashType::GA605_2025 => PROD_ID2_STR, SlashType::GA605 => PROD_ID2_STR,
SlashType::GA605_2024 => PROD_ID2_STR, SlashType::GU605 => PROD_ID1_STR,
SlashType::GU605_2025 => PROD_ID2_STR, SlashType::GU605C => PROD_ID2_STR,
SlashType::GU605_2024 => PROD_ID1_STR, SlashType::G614F => PROD_ID2_STR,
SlashType::G614_2025 => PROD_ID2_STR,
SlashType::Unsupported => "", SlashType::Unsupported => "",
} }
} }
@@ -53,19 +50,17 @@ impl SlashType {
pub fn from_dmi() -> Self { pub fn from_dmi() -> Self {
let board_name = DMIID::new().unwrap_or_default().board_name.to_uppercase(); let board_name = DMIID::new().unwrap_or_default().board_name.to_uppercase();
if board_name.contains("G614F") { if board_name.contains("G614F") {
SlashType::G614_2025 SlashType::G614F
} else if ["GA403W", "GA403UH", "GA403UM", "GA403UP"].iter().any(|s| board_name.contains(s)) { } else if ["GA403W", "GA403UH", "GA403UM", "GA403UP"].iter().any(|s| board_name.contains(s)) {
SlashType::GA403_2025 SlashType::GA403_2025
} else if board_name.contains("GA403") { } else if board_name.contains("GA403") {
SlashType::GA403_2024 SlashType::GA403
} else if board_name.contains("GA605K") {
SlashType::GA605_2025
} else if board_name.contains("GA605") { } else if board_name.contains("GA605") {
SlashType::GA605_2024 SlashType::GA605
} else if board_name.contains("GU605C") { } else if board_name.contains("GU605C") {
SlashType::GU605_2025 SlashType::GU605C
} else if board_name.contains("GU605") { } else if board_name.contains("GU605") {
SlashType::GU605_2024 SlashType::GU605
} else { } else {
SlashType::Unsupported SlashType::Unsupported
} }
@@ -78,12 +73,11 @@ impl FromStr for SlashType {
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> { fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(match s.to_uppercase().as_str() { Ok(match s.to_uppercase().as_str() {
"GA403_2025" => Self::GA403_2025, "GA403_2025" => Self::GA403_2025,
"GA403_2024" => Self::GA403_2024, "GA403" => Self::GA403,
"GA605_2025" => Self::GA605_2025, "GA605" => Self::GA605,
"GA605_2024" => Self::GA605_2024, "GU605C" => Self::GU605C,
"GU605_2025" => Self::GU605_2025, "GU605" => Self::GU605,
"GU605_2024" => Self::GU605_2024, "G614FR" => Self::G614F,
"G614_2025" => Self::G614_2025,
_ => Self::Unsupported, _ => Self::Unsupported,
}) })
} }
+10 -13
View File
@@ -39,19 +39,17 @@ pub fn get_slash_type() -> SlashType {
.unwrap_or_default(); .unwrap_or_default();
let board_name = dmi.board_name.to_uppercase(); let board_name = dmi.board_name.to_uppercase();
if board_name.contains("G614F") { if board_name.contains("G614F") {
SlashType::G614_2025 SlashType::G614F
} else if ["GA403W", "GA403UH", "GA403UM", "GA403UP"].iter().any(|s| board_name.contains(s)) { } else if ["GA403W", "GA403UH", "GA403UM", "GA403UP"].iter().any(|s| board_name.contains(s)) {
SlashType::GA403_2025 SlashType::GA403_2025
} else if board_name.contains("GA403") { } else if board_name.contains("GA403") {
SlashType::GA403_2024 SlashType::GA403
} else if board_name.contains("GA605K") {
SlashType::GA605_2025
} else if board_name.contains("GA605") { } else if board_name.contains("GA605") {
SlashType::GA605_2024 SlashType::GA605
} else if board_name.contains("GU605C") { } else if board_name.contains("GU605C") {
SlashType::GU605_2025 SlashType::GU605C
} else if board_name.contains("GU605") { } else if board_name.contains("GU605") {
SlashType::GU605_2024 SlashType::GU605
} else { } else {
SlashType::Unsupported SlashType::Unsupported
} }
@@ -60,12 +58,11 @@ pub fn get_slash_type() -> SlashType {
pub const fn report_id(slash_type: SlashType) -> u8 { pub const fn report_id(slash_type: SlashType) -> u8 {
match slash_type { match slash_type {
SlashType::GA403_2025 => REPORT_ID_19B6, SlashType::GA403_2025 => REPORT_ID_19B6,
SlashType::GA403_2024 => REPORT_ID_193B, SlashType::GA403 => REPORT_ID_193B,
SlashType::GA605_2025 => REPORT_ID_19B6, SlashType::GA605 => REPORT_ID_19B6,
SlashType::GA605_2024 => REPORT_ID_19B6, SlashType::G614F => REPORT_ID_19B6,
SlashType::GU605_2025 => REPORT_ID_19B6, SlashType::GU605 => REPORT_ID_193B,
SlashType::GU605_2024 => REPORT_ID_193B, SlashType::GU605C => REPORT_ID_19B6,
SlashType::G614_2025 => REPORT_ID_19B6,
SlashType::Unsupported => REPORT_ID_19B6, SlashType::Unsupported => REPORT_ID_19B6,
} }
} }