From 9ab65897b48df2daa089cd9deeb70f35f6aa182b Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Tue, 6 May 2025 11:14:39 +0800 Subject: [PATCH] chromium_ec: Add support for EC_CMD_PSU_CONTROL Signed-off-by: Daniel Schaefer --- framework_lib/src/chromium_ec/command.rs | 2 ++ framework_lib/src/chromium_ec/commands.rs | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/framework_lib/src/chromium_ec/command.rs b/framework_lib/src/chromium_ec/command.rs index b3067fa..55d34eb 100644 --- a/framework_lib/src/chromium_ec/command.rs +++ b/framework_lib/src/chromium_ec/command.rs @@ -119,6 +119,8 @@ pub enum EcCommands { GetPdPortState = 0x3E23, /// Read board ID of specific ADC channel ReadBoardId = 0x3E26, + /// Enable/disable force on the PSU in standby mode + PsuControl = 0x3E28, } pub trait EcRequest { diff --git a/framework_lib/src/chromium_ec/commands.rs b/framework_lib/src/chromium_ec/commands.rs index e0bb0b2..c5e65a1 100644 --- a/framework_lib/src/chromium_ec/commands.rs +++ b/framework_lib/src/chromium_ec/commands.rs @@ -1803,3 +1803,20 @@ impl EcRequest for EcRequestGetApThrottleStatus { EcCommands::GetApThrottleStatus } } + +#[repr(C, packed)] +pub struct EcRequestPsuControl { + pub force_enable_in_standby: u8, +} + +#[repr(C, packed)] +#[derive(Clone, Copy, PartialEq, Eq, Debug)] +pub struct EcResponsePsuControl { + pub force_enable_in_standby: u8, +} + +impl EcRequest for EcRequestPsuControl { + fn command_id() -> EcCommands { + EcCommands::PsuControl + } +}