From 01c331fd3376b5dd5dabeb658fbd17a901e6b91f Mon Sep 17 00:00:00 2001 From: Alec Berg Date: Fri, 3 Oct 2014 15:37:22 -0700 Subject: [PATCH] zinger: add config option for hibernate and disable by default Disable hibernate by default on zinger because some EVT zingers do not wake up on connect due to hardware problem. BUG=chrome-os-partner:28335 BRANCH=samus TEST=load onto zinger, leave disconnected for 60s, make sure it doesn't go into hibernate Change-Id: I9f5f9fb1ce349ea862652cd38aa5d1e521234b30 Signed-off-by: Alec Berg Reviewed-on: https://chromium-review.googlesource.com/221478 Reviewed-by: Vincent Palatin --- board/zinger/board.h | 1 + board/zinger/usb_pd_policy.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/board/zinger/board.h b/board/zinger/board.h index 91a96f50e0..e7e31232a0 100644 --- a/board/zinger/board.h +++ b/board/zinger/board.h @@ -41,6 +41,7 @@ #undef CONFIG_DEBUG_STACK_OVERFLOW #undef CONFIG_FLASH #undef CONFIG_FMAP +#undef CONFIG_HIBERNATE #define CONFIG_HIBERNATE_WAKEUP_PINS STM32_PWR_CSR_EWUP1 /* debug printf flash footprinf is about 1400 bytes */ diff --git a/board/zinger/usb_pd_policy.c b/board/zinger/usb_pd_policy.c index 543db00541..6c4110a289 100644 --- a/board/zinger/usb_pd_policy.c +++ b/board/zinger/usb_pd_policy.c @@ -256,14 +256,17 @@ void pd_power_supply_reset(int port) int pd_board_checks(void) { +#ifdef CONFIG_HIBERNATE static timestamp_t hib_to; static int hib_to_ready; +#endif int vbus_volt; int ovp_idx; /* Reload the watchdog */ STM32_IWDG_KR = STM32_IWDG_KR_RELOAD; +#ifdef CONFIG_HIBERNATE /* If output is disabled for long enough, then hibernate */ if (!pd_is_connected(0) && hib_to_ready) { if (get_time().val >= hib_to.val) { @@ -274,6 +277,7 @@ int pd_board_checks(void) hib_to.val = get_time().val + 60*SECOND; hib_to_ready = 1; } +#endif vbus_volt = adc_read_channel(ADC_CH_V_SENSE); vbus_amp = adc_read_channel(ADC_CH_A_SENSE);