Skip to content

Commit 9ab6589

Browse files
committed
chromium_ec: Add support for EC_CMD_PSU_CONTROL
Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 80d6426 commit 9ab6589

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

framework_lib/src/chromium_ec/command.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ pub enum EcCommands {
119119
GetPdPortState = 0x3E23,
120120
/// Read board ID of specific ADC channel
121121
ReadBoardId = 0x3E26,
122+
/// Enable/disable force on the PSU in standby mode
123+
PsuControl = 0x3E28,
122124
}
123125

124126
pub trait EcRequest<R> {

framework_lib/src/chromium_ec/commands.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,3 +1803,20 @@ impl EcRequest<EcResponseGetApThrottleStatus> for EcRequestGetApThrottleStatus {
18031803
EcCommands::GetApThrottleStatus
18041804
}
18051805
}
1806+
1807+
#[repr(C, packed)]
1808+
pub struct EcRequestPsuControl {
1809+
pub force_enable_in_standby: u8,
1810+
}
1811+
1812+
#[repr(C, packed)]
1813+
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
1814+
pub struct EcResponsePsuControl {
1815+
pub force_enable_in_standby: u8,
1816+
}
1817+
1818+
impl EcRequest<EcResponsePsuControl> for EcRequestPsuControl {
1819+
fn command_id() -> EcCommands {
1820+
EcCommands::PsuControl
1821+
}
1822+
}

0 commit comments

Comments
 (0)