diff --git a/board/cheza/board.c b/board/cheza/board.c index f2c53de96b..c22c7c6d3e 100644 --- a/board/cheza/board.c +++ b/board/cheza/board.c @@ -32,6 +32,16 @@ const enum gpio_signal hibernate_wake_pins[] = { }; const int hibernate_wake_pins_used = ARRAY_SIZE(hibernate_wake_pins); +void board_set_switchcap(int enable) +{ + /* + * Disable SwitchCap auto-boot and make EN pin level-trigger + * TODO(b/77957956): Remove it after hardware fix. + */ + i2c_write8(I2C_PORT_POWER, DA9313_I2C_ADDR, 0x02, 0x34); + gpio_set_level(GPIO_SWITCHCAP_ON_L, enable); +} + const struct adc_t adc_channels[] = {}; /* Power signal list. Must match order of enum power_signal. */ diff --git a/board/cheza/board.h b/board/cheza/board.h index 19dac3bad7..feec3a9468 100644 --- a/board/cheza/board.h +++ b/board/cheza/board.h @@ -68,6 +68,8 @@ enum adc_channel { ADC_CH_COUNT }; +void board_set_switchcap(int asserted); + #endif /* !defined(__ASSEMBLER__) */ #endif /* __CROS_EC_BOARD_H */ diff --git a/power/sdm845.c b/power/sdm845.c index 4e96c1385e..fb3eb40efc 100644 --- a/power/sdm845.c +++ b/power/sdm845.c @@ -145,7 +145,7 @@ DECLARE_HOOK(HOOK_POWER_BUTTON_CHANGE, powerbtn_sdm845_changed, static void set_system_power(int enable) { CPRINTS("set_system_power(%d)", enable); - gpio_set_level(GPIO_SWITCHCAP_ON_L, enable); + board_set_switchcap(enable); gpio_set_level(GPIO_VBOB_EN, enable); }