mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Add G731 support
This commit is contained in:
32
README.md
32
README.md
@@ -16,6 +16,9 @@ change modes and RGB settings. The previous version of this program is named
|
|||||||
`rog-core` and takes full control of the interfaces required - if you can't
|
`rog-core` and takes full control of the interfaces required - if you can't
|
||||||
apply the kernel patches then `rog-core` is still highly usable.
|
apply the kernel patches then `rog-core` is still highly usable.
|
||||||
|
|
||||||
|
Many other patches for these laptops, AMD and Intel based, are working their way
|
||||||
|
in to the kernel.
|
||||||
|
|
||||||
---
|
---
|
||||||
asusd is a utility for Linux to control many aspects of various ASUS laptops.
|
asusd is a utility for Linux to control many aspects of various ASUS laptops.
|
||||||
|
|
||||||
@@ -38,25 +41,22 @@ As far as I can see, the EC does not give us a way to find what modes are suppor
|
|||||||
|
|
||||||
### ANIME AND OTHER FUNCTIONS
|
### ANIME AND OTHER FUNCTIONS
|
||||||
|
|
||||||
| MODEL | AniMe |Touchpad-Numpad| Fan Modes | Charge Limit |
|
**AniMe device check is performed on start, if your device has one it will be detected.**
|
||||||
|:-----:|:-----:|:-------------:|:---------:|:------------:|
|
|
||||||
| GM501 | | | X | X |
|
|
||||||
| GX502 | | | X | X |
|
|
||||||
| GX531 | | | X | X |
|
|
||||||
| GX701 | | | X | X |
|
|
||||||
| G512 | | | X | X |
|
|
||||||
| G712 | | | X | X |
|
|
||||||
| G531 | | | X | X |
|
|
||||||
| G731 | | | X | X |
|
|
||||||
| G532 | | | X | X |
|
|
||||||
| GA401 | X | | X | X |
|
|
||||||
| GA502 | X | | X | X |
|
|
||||||
| GU502 | X | | X | X |
|
|
||||||
|
|
||||||
**NOTE:** GA14/GA401 and GA15/GA502/GU502, You will need kernel [patches](https://lab.retarded.farm/zappel/asus-rog-zephyrus-g14/-/tree/master/kernel_patches).
|
|
||||||
|
|
||||||
**NOTE:** If charge limit or fan modes are not working, then you may require a kernel newer than 5.6.10.
|
**NOTE:** If charge limit or fan modes are not working, then you may require a kernel newer than 5.6.10.
|
||||||
|
|
||||||
|
- [X] AniMe Matrix display
|
||||||
|
- [X] Power profile switching on fan-mode (FN+F5)
|
||||||
|
- [X] Intel
|
||||||
|
- [X] Turbo enale/disable
|
||||||
|
- [X] Min frequency percentage
|
||||||
|
- [X] Max frequency percentage
|
||||||
|
- [X] AMD
|
||||||
|
- [X] Turbo enale/disable
|
||||||
|
- [X] Battery charge limit
|
||||||
|
|
||||||
|
**NOTE:** GA14/GA401 and GA15/GA502/GU502, You will need kernel [patches](https://lab.retarded.farm/zappel/asus-rog-zephyrus-g14/-/tree/master/kernel_patches).
|
||||||
|
|
||||||
### KEYBOARD BACKLIGHT MODES
|
### KEYBOARD BACKLIGHT MODES
|
||||||
|
|
||||||
Models GA401, GA502, GU502 support LED brightness change only (no RGB).
|
Models GA401, GA502, GU502 support LED brightness change only (no RGB).
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ const APPLY: u8 = 0xc3;
|
|||||||
const SET: u8 = 0xc4;
|
const SET: u8 = 0xc4;
|
||||||
|
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use log::{error, info, warn};
|
|
||||||
use asus_nb::error::AuraError;
|
use asus_nb::error::AuraError;
|
||||||
|
use log::{error, info, warn};
|
||||||
use rusb::{Device, DeviceHandle};
|
use rusb::{Device, DeviceHandle};
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ impl crate::Controller for CtrlFanAndCPU {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// need to watch file path
|
// need to watch file path
|
||||||
|
// TODO: split this out to a struct CtrlFanAndCPUWatcher or similar
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
loop {
|
loop {
|
||||||
if let Ok(mut lock) = gate2.try_lock() {
|
if let Ok(mut lock) = gate2.try_lock() {
|
||||||
@@ -65,7 +66,10 @@ impl crate::Controller for CtrlFanAndCPU {
|
|||||||
file.write_all(format!("{:?}\n", config.power_profile).as_bytes())
|
file.write_all(format!("{:?}\n", config.power_profile).as_bytes())
|
||||||
.unwrap_or_else(|err| error!("Could not write to {}, {:?}", self.path, err));
|
.unwrap_or_else(|err| error!("Could not write to {}, {:?}", self.path, err));
|
||||||
self.set_pstate_for_fan_mode(FanLevel::from(config.power_profile), config)?;
|
self.set_pstate_for_fan_mode(FanLevel::from(config.power_profile), config)?;
|
||||||
info!("Reloaded fan mode: {:?}", FanLevel::from(config.power_profile));
|
info!(
|
||||||
|
"Reloaded fan mode: {:?}",
|
||||||
|
FanLevel::from(config.power_profile)
|
||||||
|
);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -128,7 +132,10 @@ impl CtrlFanAndCPU {
|
|||||||
fan_ctrl
|
fan_ctrl
|
||||||
.write_all(format!("{:?}\n", config.power_profile).as_bytes())
|
.write_all(format!("{:?}\n", config.power_profile).as_bytes())
|
||||||
.unwrap_or_else(|err| error!("Could not write to {}, {:?}", self.path, err));
|
.unwrap_or_else(|err| error!("Could not write to {}, {:?}", self.path, err));
|
||||||
info!("Fan mode set to: {:?}", FanLevel::from(config.power_profile));
|
info!(
|
||||||
|
"Fan mode set to: {:?}",
|
||||||
|
FanLevel::from(config.power_profile)
|
||||||
|
);
|
||||||
self.set_pstate_for_fan_mode(FanLevel::from(n), config)?;
|
self.set_pstate_for_fan_mode(FanLevel::from(n), config)?;
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ static LED_APPLY: [u8; 17] = [0x5d, 0xb4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
|||||||
static LED_SET: [u8; 17] = [0x5d, 0xb5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
static LED_SET: [u8; 17] = [0x5d, 0xb5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
||||||
|
|
||||||
use crate::{config::Config, error::RogError};
|
use crate::{config::Config, error::RogError};
|
||||||
use dbus::{channel::Sender, nonblock::SyncConnection, tree::Signal};
|
|
||||||
use log::{info, warn};
|
|
||||||
use asus_nb::{
|
use asus_nb::{
|
||||||
aura_brightness_bytes, aura_modes::AuraModes, fancy::KeyColourArray, DBUS_IFACE, DBUS_PATH,
|
aura_brightness_bytes, aura_modes::AuraModes, fancy::KeyColourArray, DBUS_IFACE, DBUS_PATH,
|
||||||
LED_MSG_LEN,
|
LED_MSG_LEN,
|
||||||
};
|
};
|
||||||
|
use dbus::{channel::Sender, nonblock::SyncConnection, tree::Signal};
|
||||||
|
use log::{info, warn};
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
use std::fs::OpenOptions;
|
use std::fs::OpenOptions;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|||||||
@@ -1,19 +1,20 @@
|
|||||||
use daemon::{
|
use daemon::{
|
||||||
config::Config, ctrl_anime::CtrlAnimeDisplay, ctrl_charge::CtrlCharge, ctrl_fan_cpu::CtrlFanAndCPU,
|
config::Config, ctrl_anime::CtrlAnimeDisplay, ctrl_charge::CtrlCharge,
|
||||||
ctrl_leds::CtrlKbdBacklight, dbus::dbus_create_tree, laptops::match_laptop,
|
ctrl_fan_cpu::CtrlFanAndCPU, ctrl_leds::CtrlKbdBacklight, dbus::dbus_create_tree,
|
||||||
|
laptops::match_laptop,
|
||||||
};
|
};
|
||||||
|
|
||||||
use dbus::{channel::Sender, nonblock::SyncConnection, tree::Signal};
|
use dbus::{channel::Sender, nonblock::SyncConnection, tree::Signal};
|
||||||
|
|
||||||
|
use asus_nb::{DBUS_IFACE, DBUS_NAME, DBUS_PATH};
|
||||||
use daemon::Controller;
|
use daemon::Controller;
|
||||||
use dbus_tokio::connection;
|
use dbus_tokio::connection;
|
||||||
use log::{error, warn, info};
|
use log::LevelFilter;
|
||||||
use asus_nb::{DBUS_IFACE, DBUS_NAME, DBUS_PATH};
|
use log::{error, info, warn};
|
||||||
use std::error::Error;
|
use std::error::Error;
|
||||||
|
use std::io::Write;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tokio::sync::Mutex;
|
use tokio::sync::Mutex;
|
||||||
use std::io::Write;
|
|
||||||
use log::LevelFilter;
|
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
@@ -42,14 +43,15 @@ pub async fn start_daemon() -> Result<(), Box<dyn Error>> {
|
|||||||
let laptop = match_laptop();
|
let laptop = match_laptop();
|
||||||
let mut config = Config::default().load(laptop.supported_modes());
|
let mut config = Config::default().load(laptop.supported_modes());
|
||||||
|
|
||||||
let mut led_control = CtrlKbdBacklight::new(laptop.usb_product(), laptop.supported_modes().to_owned())
|
let mut led_control =
|
||||||
.map_or_else(
|
CtrlKbdBacklight::new(laptop.usb_product(), laptop.supported_modes().to_owned())
|
||||||
|err| {
|
.map_or_else(
|
||||||
error!("{}", err);
|
|err| {
|
||||||
None
|
error!("{}", err);
|
||||||
},
|
None
|
||||||
Some,
|
},
|
||||||
);
|
Some,
|
||||||
|
);
|
||||||
|
|
||||||
let mut charge_control = CtrlCharge::new().map_or_else(
|
let mut charge_control = CtrlCharge::new().map_or_else(
|
||||||
|err| {
|
|err| {
|
||||||
@@ -207,7 +209,6 @@ async fn send_boot_signals(
|
|||||||
charge_limit_signal: Arc<Signal<()>>,
|
charge_limit_signal: Arc<Signal<()>>,
|
||||||
led_changed_signal: Arc<Signal<()>>,
|
led_changed_signal: Arc<Signal<()>>,
|
||||||
) -> Result<(), Box<dyn Error>> {
|
) -> Result<(), Box<dyn Error>> {
|
||||||
|
|
||||||
let config = config.lock().await;
|
let config = config.lock().await;
|
||||||
|
|
||||||
if let Some(data) = config.get_led_mode_data(config.kbd_backlight_mode) {
|
if let Some(data) = config.get_led_mode_data(config.kbd_backlight_mode) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
|
use asus_nb::{aura_modes::AuraModes, DBUS_IFACE, DBUS_PATH};
|
||||||
use dbus::tree::{Factory, MTSync, Method, MethodErr, Signal, Tree};
|
use dbus::tree::{Factory, MTSync, Method, MethodErr, Signal, Tree};
|
||||||
use log::warn;
|
use log::warn;
|
||||||
use asus_nb::{aura_modes::AuraModes, DBUS_IFACE, DBUS_PATH};
|
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use tokio::sync::{
|
use tokio::sync::{
|
||||||
mpsc::{channel, Receiver, Sender},
|
mpsc::{channel, Receiver, Sender},
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
use log::{info, warn};
|
|
||||||
use asus_nb::aura_modes::{
|
use asus_nb::aura_modes::{
|
||||||
AuraModes, BREATHING, COMET, FLASH, HIGHLIGHT, LASER, MULTISTATIC, PULSE, RAIN, RAINBOW, RGB,
|
AuraModes, BREATHING, COMET, FLASH, HIGHLIGHT, LASER, MULTISTATIC, PULSE, RAIN, RAINBOW, RGB,
|
||||||
RIPPLE, STATIC, STAR, STROBE,
|
RIPPLE, STAR, STATIC, STROBE,
|
||||||
};
|
};
|
||||||
|
use log::{info, warn};
|
||||||
|
|
||||||
static HELP_ADDRESS: &str = "https://gitlab.com/asus-linux/asus-nb-ctrl";
|
static HELP_ADDRESS: &str = "https://gitlab.com/asus-linux/asus-nb-ctrl";
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
use daemon::ctrl_fan_cpu::FanLevel;
|
|
||||||
use gumdrop::Options;
|
|
||||||
use log::LevelFilter;
|
|
||||||
use asus_nb::{
|
use asus_nb::{
|
||||||
cli_options::{LedBrightness, SetAuraBuiltin},
|
cli_options::{LedBrightness, SetAuraBuiltin},
|
||||||
core_dbus::AuraDbusClient,
|
core_dbus::AuraDbusClient,
|
||||||
};
|
};
|
||||||
|
use daemon::ctrl_fan_cpu::FanLevel;
|
||||||
|
use gumdrop::Options;
|
||||||
|
use log::LevelFilter;
|
||||||
use std::io::Write;
|
use std::io::Write;
|
||||||
|
|
||||||
#[derive(Options)]
|
#[derive(Options)]
|
||||||
|
|||||||
Reference in New Issue
Block a user