diff --git a/src/mainboard/google/bluey/board.h b/src/mainboard/google/bluey/board.h index 4a84e6333d..af2715b898 100644 --- a/src/mainboard/google/bluey/board.h +++ b/src/mainboard/google/bluey/board.h @@ -41,6 +41,7 @@ #endif void setup_chromeos_gpios(void); +bool is_off_mode(void); void enable_slow_battery_charging(void); void disable_slow_battery_charging(void); diff --git a/src/mainboard/google/bluey/charging.c b/src/mainboard/google/bluey/charging.c index 2c1e447585..56deedcdb9 100644 --- a/src/mainboard/google/bluey/charging.c +++ b/src/mainboard/google/bluey/charging.c @@ -1,7 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include "board.h" +#include #include +#include #define SMB1_SLAVE_ID 0x07 #define SMB2_SLAVE_ID 0x0A @@ -41,3 +43,19 @@ void disable_slow_battery_charging(void) spmi_write8(SMB1_CHGR_CHRG_EN_CMD, CHRG_DISABLE); spmi_write8(SMB2_CHGR_CHRG_EN_CMD, CHRG_DISABLE); } + +/* + * is_off_mode - Check if the system is booting due to an off-mode power event. + * + * This function provides the board-level policy wrapper for detecting if the + * system power-on was triggered by an external charging event (e.g., cable + * insertion). This is typically used to enter LB_BOOT_MODE_OFFMODE_CHARGING. + * + * @return true if the system was triggered by a specific off-mode reason + * (e.g., charging cable insertion). + * @return false otherwise. + */ +bool is_off_mode(void) +{ + return is_pon_on_ac(); +}