From a1dd5f05b0b17a0c09da936ea1613088f756d476 Mon Sep 17 00:00:00 2001 From: Subrata Banik Date: Sun, 1 Mar 2026 11:03:09 +0530 Subject: [PATCH] ec/google/chromeec: Add interface for offmode heartbeat command Implement google_chromeec_offmode_heartbeat() to wrap the EC_CMD_ENABLE_OFFMODE_HEARTBEAT host command. This allows the AP to signal the EC to maintain the power state required for off-mode UI (such as the charging applet) during shutdown or low-power transitions. BUG=b:439819922 BRANCH=none TEST=Build and verify that the charger applet can successfully call this function to enable heartbeat signaling. Change-Id: Ic2ed464bf454e614a098ee5bbbb662adc9d79144 Signed-off-by: Subrata Banik Reviewed-on: https://review.coreboot.org/c/coreboot/+/91484 Reviewed-by: Kapil Porwal Tested-by: build bot (Jenkins) Reviewed-by: Caveh Jalali --- src/ec/google/chromeec/ec.c | 9 +++++++++ src/ec/google/chromeec/ec.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index ab4df3dde2..5b89dac265 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -795,6 +795,15 @@ int rtc_get(struct rtc_time *time) } #endif +int google_chromeec_offmode_heartbeat(void) +{ + struct chromeec_command cmd = { + .cmd_code = EC_CMD_ENABLE_OFFMODE_HEARTBEAT, + }; + + return google_chromeec_command(&cmd); +} + int google_chromeec_reboot(enum ec_reboot_cmd type, uint8_t flags) { const struct ec_params_reboot_ec params = { diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h index 73ec3eeda8..aadd51ff22 100644 --- a/src/ec/google/chromeec/ec.h +++ b/src/ec/google/chromeec/ec.h @@ -110,6 +110,8 @@ int google_chromeec_reboot(enum ec_reboot_cmd type, uint8_t flags); void google_chromeec_ap_poweroff(void); +int google_chromeec_offmode_heartbeat(void); + /** * Get data from Cros Board Info *