mirror of
https://gitlab.com/asus-linux/asusctl.git
synced 2026-02-06 00:15:04 +01:00
Prep 6.1.0-rc4
This commit is contained in:
@@ -44,14 +44,14 @@ pub struct CtrlPlatform {
|
||||
power: AsusPower,
|
||||
platform: RogPlatform,
|
||||
cpu_control: Option<CPUControl>,
|
||||
config: Arc<Mutex<Config>>,
|
||||
config: Arc<Mutex<Config>>
|
||||
}
|
||||
|
||||
impl CtrlPlatform {
|
||||
pub fn new(
|
||||
config: Arc<Mutex<Config>>,
|
||||
config_path: &Path,
|
||||
signal_context: SignalEmitter<'static>,
|
||||
signal_context: SignalEmitter<'static>
|
||||
) -> Result<Self, RogError> {
|
||||
let platform = RogPlatform::new()?;
|
||||
let power = AsusPower::new()?;
|
||||
@@ -64,7 +64,7 @@ impl CtrlPlatform {
|
||||
config,
|
||||
cpu_control: CPUControl::new()
|
||||
.map_err(|e| error!("Couldn't get CPU control sysfs: {e}"))
|
||||
.ok(),
|
||||
.ok()
|
||||
};
|
||||
let mut inotify_self = ret_self.clone();
|
||||
|
||||
@@ -83,7 +83,7 @@ impl CtrlPlatform {
|
||||
inotify::WatchMask::MODIFY
|
||||
| inotify::WatchMask::CLOSE_WRITE
|
||||
| inotify::WatchMask::ATTRIB
|
||||
| inotify::WatchMask::CREATE,
|
||||
| inotify::WatchMask::CREATE
|
||||
)
|
||||
.inspect_err(|e| {
|
||||
if e.kind() == std::io::ErrorKind::NotFound {
|
||||
@@ -125,7 +125,7 @@ impl CtrlPlatform {
|
||||
if limit > 0
|
||||
&& std::mem::replace(
|
||||
&mut self.config.lock().await.charge_control_end_threshold,
|
||||
limit,
|
||||
limit
|
||||
) != limit
|
||||
{
|
||||
self.power
|
||||
@@ -207,7 +207,7 @@ impl CtrlPlatform {
|
||||
match throttle {
|
||||
ThrottlePolicy::Balanced => self.config.lock().await.throttle_balanced_epp,
|
||||
ThrottlePolicy::Performance => self.config.lock().await.throttle_performance_epp,
|
||||
ThrottlePolicy::Quiet => self.config.lock().await.throttle_quiet_epp,
|
||||
ThrottlePolicy::Quiet => self.config.lock().await.throttle_quiet_epp
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,7 +304,7 @@ impl CtrlPlatform {
|
||||
async fn one_shot_full_charge(&self) -> Result<(), FdoErr> {
|
||||
let base_limit = std::mem::replace(
|
||||
&mut self.config.lock().await.charge_control_end_threshold,
|
||||
100,
|
||||
100
|
||||
);
|
||||
if base_limit != 100 {
|
||||
self.power.set_charge_control_end_threshold(100)?;
|
||||
@@ -318,7 +318,7 @@ impl CtrlPlatform {
|
||||
/// If fan-curves are supported will also activate a fan curve for profile.
|
||||
async fn next_throttle_thermal_policy(
|
||||
&mut self,
|
||||
#[zbus(signal_context)] ctxt: SignalEmitter<'_>,
|
||||
#[zbus(signal_context)] ctxt: SignalEmitter<'_>
|
||||
) -> Result<(), FdoErr> {
|
||||
let policy: ThrottlePolicy =
|
||||
platform_get_value!(self, throttle_thermal_policy, "throttle_thermal_policy")
|
||||
@@ -338,7 +338,7 @@ impl CtrlPlatform {
|
||||
Ok(self.throttle_thermal_policy_changed(&ctxt).await?)
|
||||
} else {
|
||||
Err(FdoErr::NotSupported(
|
||||
"RogPlatform: throttle_thermal_policy not supported".to_owned(),
|
||||
"RogPlatform: throttle_thermal_policy not supported".to_owned()
|
||||
))
|
||||
}
|
||||
}
|
||||
@@ -365,7 +365,7 @@ impl CtrlPlatform {
|
||||
})
|
||||
} else {
|
||||
Err(FdoErr::NotSupported(
|
||||
"RogPlatform: throttle_thermal_policy not supported".to_owned(),
|
||||
"RogPlatform: throttle_thermal_policy not supported".to_owned()
|
||||
))
|
||||
}
|
||||
}
|
||||
@@ -390,7 +390,7 @@ impl CtrlPlatform {
|
||||
#[zbus(property)]
|
||||
async fn set_throttle_policy_on_battery(
|
||||
&mut self,
|
||||
policy: ThrottlePolicy,
|
||||
policy: ThrottlePolicy
|
||||
) -> Result<(), FdoErr> {
|
||||
self.config.lock().await.throttle_policy_on_battery = policy;
|
||||
self.set_throttle_thermal_policy(policy).await?;
|
||||
@@ -497,7 +497,7 @@ impl ReloadAndNotify for CtrlPlatform {
|
||||
async fn reload_and_notify(
|
||||
&mut self,
|
||||
signal_context: &SignalEmitter<'static>,
|
||||
data: Self::Data,
|
||||
data: Self::Data
|
||||
) -> Result<(), RogError> {
|
||||
let mut config = self.config.lock().await;
|
||||
if *config != data {
|
||||
@@ -527,7 +527,7 @@ impl ReloadAndNotify for CtrlPlatform {
|
||||
let epp = match profile {
|
||||
ThrottlePolicy::Balanced => data.throttle_balanced_epp,
|
||||
ThrottlePolicy::Performance => data.throttle_performance_epp,
|
||||
ThrottlePolicy::Quiet => data.throttle_quiet_epp,
|
||||
ThrottlePolicy::Quiet => data.throttle_quiet_epp
|
||||
};
|
||||
warn!("setting epp to {epp:?}");
|
||||
self.check_and_set_epp(epp, true);
|
||||
@@ -598,7 +598,7 @@ impl CtrlTask for CtrlPlatform {
|
||||
platform1
|
||||
.power
|
||||
.set_charge_control_end_threshold(
|
||||
platform1.config.lock().await.charge_control_end_threshold,
|
||||
platform1.config.lock().await.charge_control_end_threshold
|
||||
)
|
||||
.ok();
|
||||
}
|
||||
@@ -632,7 +632,7 @@ impl CtrlTask for CtrlPlatform {
|
||||
platform2
|
||||
.power
|
||||
.set_charge_control_end_threshold(
|
||||
lock.base_charge_control_end_threshold,
|
||||
lock.base_charge_control_end_threshold
|
||||
)
|
||||
.map_err(|err| {
|
||||
warn!("CtrlCharge: charge_control_end_threshold {}", err);
|
||||
@@ -662,7 +662,7 @@ impl CtrlTask for CtrlPlatform {
|
||||
platform3.restore_charge_limit().await;
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
)
|
||||
.await;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user