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 <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/221478
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Alec Berg
2014-10-03 15:37:22 -07:00
committed by chrome-internal-fetch
parent 876b0f0bdc
commit 01c331fd33
2 changed files with 5 additions and 0 deletions

View File

@@ -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 */

View File

@@ -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);