From 202fbe680010c280cf534288b950fde742c3da65 Mon Sep 17 00:00:00 2001 From: Luke Date: Sat, 4 Jul 2020 10:13:46 +1200 Subject: [PATCH] Add support for GU502 --- CHANGELOG.md | 5 +++++ README.md | 8 +++++--- debian/changelog | 7 +++++++ rog-core/src/daemon.rs | 3 ++- rog-core/src/laptops.rs | 6 +++++- rog-core/src/main.rs | 4 +++- rog-core/src/rog_dbus.rs | 2 +- 7 files changed, 28 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92fc86eb..7bdfb66a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [0.14.1] - 2020-04-07 +### Added +- Support for G512 series +- Support for GU502 (variant of GA15) + ## [0.14.0] - 2020-01-07 ### Changed - Further refine the way setting LED modes works so it is more universal, this diff --git a/README.md b/README.md index 2b5a9d61..1024185c 100644 --- a/README.md +++ b/README.md @@ -20,18 +20,20 @@ kernel level support. ## SUPPORTED LAPTOPS -- GM501 (multizone needs testing, if you have this laptop please create an issue in the repo) +- GM501 - GX502 - GX531 +- G512 - G712 +- GX531 - G531 - GA14/GA401 *is* supported, including the AniMe display. You will need kernel [patches](https://lab.retarded.farm/zappel/asus-rog-zephyrus-g14/-/tree/master/kernel_patches). -- GA15/GA502 appears to have most things working +- GA15/GA502/GU502 appears to have most things working **Please help test or provide info for:** - GL703(0x1869) -- GL553(0x1854) GL753 (attempted support from researching 2nd-hand info, multizone may work) +- GL553/GL753 (device = 0x1854) (attempted support from researching 2nd-hand info, multizone may work) **Laptop support is added on a per-case basis** as the EC for the keyboard varies a little between models, e.g, some RGB modes are missing, or it's a single colour. diff --git a/debian/changelog b/debian/changelog index 332059b8..ddad9608 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +rog-core (0.14.1) focal; urgency=medium + + - Support for G512 series + - Support for GU502 (variant of GA15) + + -- Luke Jones Sat, 04 Jul 2020 10:18:08 +1200 + rog-core (0.14.0) focal; urgency=medium - Further refine the way setting LED modes works so it is more universal, this diff --git a/rog-core/src/daemon.rs b/rog-core/src/daemon.rs index ea594d49..42d70e4f 100644 --- a/rog-core/src/daemon.rs +++ b/rog-core/src/daemon.rs @@ -28,7 +28,7 @@ pub(super) type DbusU8Type = Arc>>; // // DBUS processing takes 6ms if not tokiod pub async fn start_daemon() -> Result<(), Box> { - let laptop = match_laptop(); + let mut laptop = match_laptop(); let mut config = Config::default().load(laptop.supported_modes()); info!("Config loaded"); @@ -113,6 +113,7 @@ pub async fn start_daemon() -> Result<(), Box> { .unwrap_or_else(|err| warn!("{}", err)); } }); + laptop.set_support_animatrix(false); } } diff --git a/rog-core/src/laptops.rs b/rog-core/src/laptops.rs index a2f9bdd0..167e0918 100644 --- a/rog-core/src/laptops.rs +++ b/rog-core/src/laptops.rs @@ -68,9 +68,10 @@ fn choose_1866_device(prod: u16) -> LaptopBase { // GA401 if board_name.starts_with("GA401") { info!("No RGB control available"); + // TODO: actual check for the AniMe device here laptop.support_animatrix = true; // GA502 - } else if board_name.starts_with("GA502") { + } else if board_name.starts_with("GA502") || board_name.starts_with("GU502") { info!("No RGB control available"); // GX502, G712 } else if board_name.starts_with("GX502") { @@ -246,6 +247,9 @@ impl LaptopBase { pub(super) fn support_animatrix(&self) -> bool { self.support_animatrix } + pub(super) fn set_support_animatrix(&mut self, supported: bool) { + self.support_animatrix = supported; + } } pub enum FnKeys { diff --git a/rog-core/src/main.rs b/rog-core/src/main.rs index b4d22951..b87e2150 100644 --- a/rog-core/src/main.rs +++ b/rog-core/src/main.rs @@ -1,6 +1,7 @@ use daemon::daemon::start_daemon; use daemon::rogcore::FanLevel; use gumdrop::Options; +use log::info; use log::LevelFilter; use rog_client::{ cli_options::{LedBrightness, SetAuraBuiltin}, @@ -8,7 +9,7 @@ use rog_client::{ }; use std::io::Write; -static VERSION: &str = "0.14.0"; +static VERSION: &str = "0.14.1"; #[derive(Options)] struct CLIStart { @@ -53,6 +54,7 @@ pub async fn main() -> Result<(), Box> { let parsed = CLIStart::parse_args_default_or_exit(); if parsed.daemon { + info!("Version: {}", VERSION); start_daemon().await?; } if parsed.version { diff --git a/rog-core/src/rog_dbus.rs b/rog-core/src/rog_dbus.rs index 8ed66188..1e817cce 100644 --- a/rog-core/src/rog_dbus.rs +++ b/rog-core/src/rog_dbus.rs @@ -219,7 +219,7 @@ pub(super) fn dbus_create_tree( .add_m(get_fan_mode(config.clone())) .add_m(get_charge_limit(config.clone())) .add_m(get_keyboard_backlight(config.clone())) - .add_m(get_keyboard_backlight_modes(config.clone())) + .add_m(get_keyboard_backlight_modes(config)) .add_s(key_backlight_changed.clone()) .add_s(fanmode_changed.clone()) .add_s(chrg_limit_changed.clone()),