diff options
Diffstat (limited to 'board/samus/power_sequence.c')
-rw-r--r-- | board/samus/power_sequence.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/board/samus/power_sequence.c b/board/samus/power_sequence.c index ffa8999b0a..b5d2e9a176 100644 --- a/board/samus/power_sequence.c +++ b/board/samus/power_sequence.c @@ -9,6 +9,7 @@ #include "chipset.h" #include "common.h" #include "console.h" +#include "extpower.h" #include "gpio.h" #include "hooks.h" #include "host_command.h" @@ -85,7 +86,12 @@ static void chipset_force_g3(void) gpio_set_level(GPIO_PP1800_EN, 0); gpio_set_level(GPIO_PP3300_DSW_GATED_EN, 0); gpio_set_level(GPIO_PP5000_USB_EN, 0); - gpio_set_level(GPIO_PP5000_EN, 0); + /* + * Don't disable PP5000 if AC is attached because we need + * it for accurate CC line voltage measurement on PD MCU. + */ + if (!extpower_is_present()) + gpio_set_level(GPIO_PP5000_EN, 0); gpio_set_level(GPIO_PCH_RSMRST_L, 0); gpio_set_level(GPIO_PCH_DPWROK, 0); gpio_set_level(GPIO_PP3300_DSW_EN, 0); @@ -468,7 +474,13 @@ enum power_state power_handle_state(enum power_state state) /* Turn off power rails enabled in S5 */ gpio_set_level(GPIO_PP1050_EN, 0); - gpio_set_level(GPIO_PP5000_EN, 0); + + /* + * Don't disable PP5000 if AC is attached because we need + * it for accurate CC line voltage measurement on PD MCU. + */ + if (!extpower_is_present()) + gpio_set_level(GPIO_PP5000_EN, 0); /* Disable 3.3V DSW */ gpio_set_level(GPIO_PP3300_DSW_EN, 0); @@ -491,6 +503,13 @@ int lb_power(int enabled) return 0; /* + * Don't disable PP5000 if AC is attached because we need it for + * accurate CC line voltage measurement on PD MCU. + */ + if (!enabled && extpower_is_present()) + return 0; + + /* * If the AP is off, we can still turn the lightbar on briefly. * When turning on, we have to wait for the rails to come up fully * before we the lightbar ICs will respond. There's not a reliable |