mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Merge branch 'ga403wr' into 'devel'
add support for ga403wr, zephyrus g14 2025 See merge request asus-linux/asusctl!235
This commit is contained in:
@@ -13,6 +13,7 @@ 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,
|
GA403,
|
||||||
|
GA403WR,
|
||||||
GA605,
|
GA605,
|
||||||
GU605,
|
GU605,
|
||||||
#[default]
|
#[default]
|
||||||
@@ -22,6 +23,7 @@ pub enum SlashType {
|
|||||||
impl SlashType {
|
impl SlashType {
|
||||||
pub const fn prod_id(&self) -> u16 {
|
pub const fn prod_id(&self) -> u16 {
|
||||||
match self {
|
match self {
|
||||||
|
SlashType::GA403WR => PROD_ID2,
|
||||||
SlashType::GA403 => PROD_ID1,
|
SlashType::GA403 => PROD_ID1,
|
||||||
SlashType::GA605 => PROD_ID2,
|
SlashType::GA605 => PROD_ID2,
|
||||||
SlashType::GU605 => PROD_ID1,
|
SlashType::GU605 => PROD_ID1,
|
||||||
@@ -31,6 +33,7 @@ impl SlashType {
|
|||||||
|
|
||||||
pub const fn prod_id_str(&self) -> &str {
|
pub const fn prod_id_str(&self) -> &str {
|
||||||
match self {
|
match self {
|
||||||
|
SlashType::GA403WR => PROD_ID2_STR,
|
||||||
SlashType::GA403 => PROD_ID1_STR,
|
SlashType::GA403 => PROD_ID1_STR,
|
||||||
SlashType::GA605 => PROD_ID2_STR,
|
SlashType::GA605 => PROD_ID2_STR,
|
||||||
SlashType::GU605 => PROD_ID1_STR,
|
SlashType::GU605 => PROD_ID1_STR,
|
||||||
@@ -40,7 +43,9 @@ 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("GA403") {
|
if board_name.contains("GA403WR") {
|
||||||
|
SlashType::GA403WR
|
||||||
|
} else if board_name.contains("GA403") {
|
||||||
SlashType::GA403
|
SlashType::GA403
|
||||||
} else if board_name.contains("GA605") {
|
} else if board_name.contains("GA605") {
|
||||||
SlashType::GA605
|
SlashType::GA605
|
||||||
@@ -57,6 +62,7 @@ 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 {
|
Ok(match s {
|
||||||
|
"ga403wr" | "GA403WR" => Self::GA403WR,
|
||||||
"ga403" | "GA403" => Self::GA403,
|
"ga403" | "GA403" => Self::GA403,
|
||||||
"ga605" | "GA605" => Self::GA605,
|
"ga605" | "GA605" => Self::GA605,
|
||||||
"gu605" | "GU605" => Self::GU605,
|
"gu605" | "GU605" => Self::GU605,
|
||||||
|
|||||||
@@ -38,8 +38,9 @@ pub fn get_slash_type() -> SlashType {
|
|||||||
.map_err(|_| SlashError::NoDevice)
|
.map_err(|_| SlashError::NoDevice)
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
let board_name = dmi.board_name;
|
let board_name = dmi.board_name;
|
||||||
|
if board_name.contains("GA403WR") {
|
||||||
if board_name.contains("GA403") {
|
SlashType::GA403WR
|
||||||
|
} else if board_name.contains("GA403") {
|
||||||
SlashType::GA403
|
SlashType::GA403
|
||||||
} else if board_name.contains("GA605") {
|
} else if board_name.contains("GA605") {
|
||||||
SlashType::GA605
|
SlashType::GA605
|
||||||
@@ -52,6 +53,7 @@ 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::GA403WR => REPORT_ID_19B6,
|
||||||
SlashType::GA403 => REPORT_ID_193B,
|
SlashType::GA403 => REPORT_ID_193B,
|
||||||
SlashType::GA605 => REPORT_ID_19B6,
|
SlashType::GA605 => REPORT_ID_19B6,
|
||||||
SlashType::GU605 => REPORT_ID_193B,
|
SlashType::GU605 => REPORT_ID_193B,
|
||||||
|
|||||||
Reference in New Issue
Block a user