summaryrefslogtreecommitdiff
path: root/board/zinger/hardware.c
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2014-05-14 17:39:30 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-08-23 02:42:17 +0000
commit2e0de3c50f0106264303d2b8b55ec6253d9eda55 (patch)
tree1a71cadbfdaa8b1cb7a6476c1cf9c75cf0634c54 /board/zinger/hardware.c
parent6f22113a78ba2958128bf129fae80e48148d890e (diff)
downloadchrome-ec-2e0de3c50f0106264303d2b8b55ec6253d9eda55.tar.gz
zinger: add voltage discharge
When the power supply voltage is transitioning to a lower value, use the discharging FET to ensure that the voltage is acceptable before re-enabling the output. Note: when discharging, we must disable the fast OCP ADC interrupt, but that is ok because we still have the slow OCP check in board_checks(). BRANCH=none BUG=chrome-os-partner:28332 TEST=on Zinger, transition from 20V to 5V using Firefly buttons and observe that we no longer have an over-voltage event. Also, verified that fast OCP triggering still works after a discharge. Change-Id: Ie327645e74819aebd1260f5ce16b2ba46a674a7b Signed-off-by: Vincent Palatin <vpalatin@chromium.org> Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/201577 Reviewed-by: Todd Broch <tbroch@chromium.org>
Diffstat (limited to 'board/zinger/hardware.c')
-rw-r--r--board/zinger/hardware.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/board/zinger/hardware.c b/board/zinger/hardware.c
index fd9b86ff15..fc0612eeb9 100644
--- a/board/zinger/hardware.c
+++ b/board/zinger/hardware.c
@@ -244,6 +244,8 @@ int adc_disable_watchdog(void)
STM32_ADC_CFGR1 = 1 << 12;
/* Disable interrupt */
STM32_ADC_IER = 0;
+ /* Clear flags */
+ STM32_ADC_ISR = 0x8e;
return EC_SUCCESS;
}