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 <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/240398
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
Alec Berg
2015-01-13 10:12:06 -08:00
committed by ChromeOS Commit Bot
parent a13309c180
commit b34152199d

View File

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