diff options
-rw-r--r-- | board/cheza/board.c | 16 | ||||
-rw-r--r-- | power/sdm845.c | 9 |
2 files changed, 21 insertions, 4 deletions
diff --git a/board/cheza/board.c b/board/cheza/board.c index 21ef62ae19..badbfbef6c 100644 --- a/board/cheza/board.c +++ b/board/cheza/board.c @@ -162,13 +162,21 @@ BUILD_ASSERT(ARRAY_SIZE(pwm_channels) == PWM_CH_COUNT); /* Power signal list. Must match order of enum power_signal. */ const struct power_signal_info power_signal_list[] = { [SDM845_AP_RST_L] = { - GPIO_AP_RST_L, POWER_SIGNAL_ACTIVE_HIGH, "AP_RST_L"}, + GPIO_AP_RST_L, + POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, + "AP_RST_L"}, [SDM845_PS_HOLD] = { - GPIO_PS_HOLD, POWER_SIGNAL_ACTIVE_HIGH, "PS_HOLD"}, + GPIO_PS_HOLD, + POWER_SIGNAL_ACTIVE_HIGH, + "PS_HOLD"}, [SDM845_PMIC_FAULT_L] = { - GPIO_PMIC_FAULT_L, POWER_SIGNAL_ACTIVE_HIGH, "PMIC_FAULT_L"}, + GPIO_PMIC_FAULT_L, + POWER_SIGNAL_ACTIVE_HIGH | POWER_SIGNAL_DISABLE_AT_BOOT, + "PMIC_FAULT_L"}, [SDM845_POWER_GOOD] = { - GPIO_POWER_GOOD, POWER_SIGNAL_ACTIVE_HIGH, "POWER_GOOD"}, + GPIO_POWER_GOOD, + POWER_SIGNAL_ACTIVE_HIGH, + "POWER_GOOD"}, }; BUILD_ASSERT(ARRAY_SIZE(power_signal_list) == POWER_SIGNAL_COUNT); diff --git a/power/sdm845.c b/power/sdm845.c index 81c18fb804..5b59e8cab9 100644 --- a/power/sdm845.c +++ b/power/sdm845.c @@ -384,6 +384,10 @@ static void power_off(void) /* Do a graceful way to shutdown PMIC/AP first */ set_pmic_pwron(0); + /* Disable signal interrupts, as they are floating when switchcap off */ + power_signal_disable_interrupt(GPIO_AP_RST_L); + power_signal_disable_interrupt(GPIO_PMIC_FAULT_L); + /* Force to switch off all rails */ set_system_power(0); @@ -452,6 +456,11 @@ static void power_on(void) set_system_power(1); usleep(SYSTEM_POWER_ON_DELAY); + + /* Enable signal interrupts */ + power_signal_enable_interrupt(GPIO_AP_RST_L); + power_signal_enable_interrupt(GPIO_PMIC_FAULT_L); + set_pmic_pwron(1); disable_sleep(SLEEP_MASK_AP_RUN); |