From b34152199d341175877eba293af5bc230f70b226 Mon Sep 17 00:00:00 2001 From: Alec Berg Date: Tue, 13 Jan 2015 10:12:06 -0800 Subject: [PATCH] zinger: fix reading of output and discharge gpio states Change the reads of output enable and discharge gpio's to use the output data register (ODR) instead of reading input data register (IDR) because we are really intending to read it's output state, what we have set it to. BUG=none BRANCH=zinger TEST=make -j buildall. load on zinger and use it normally. Change-Id: I308bbb659aa26a9d0bca8caef6d1257fc1146ae9 Signed-off-by: Alec Berg Reviewed-on: https://chromium-review.googlesource.com/240398 Reviewed-by: Vincent Palatin --- board/zinger/usb_pd_policy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/zinger/usb_pd_policy.c b/board/zinger/usb_pd_policy.c index 50661a1c57..2e0c8bf4e5 100644 --- a/board/zinger/usb_pd_policy.c +++ b/board/zinger/usb_pd_policy.c @@ -50,7 +50,7 @@ static inline void output_disable(void) static inline int output_is_enabled(void) { /* GPF0 = enable output FET */ - return STM32_GPIO_IDR(GPIO_F) & 1; + return STM32_GPIO_ODR(GPIO_F) & 1; } /* ----- fault conditions ----- */ @@ -135,7 +135,7 @@ static inline void discharge_disable(void) static inline int discharge_is_enabled(void) { /* GPF1 = enable discharge FET */ - return STM32_GPIO_IDR(GPIO_F) & 2; + return STM32_GPIO_ODR(GPIO_F) & 2; } static void discharge_voltage(int target_volt)