summaryrefslogtreecommitdiff
path: root/board/hatch_fp/fpsensor_detect_rw.c
diff options
context:
space:
mode:
authorPatryk Duda <pdk@semihalf.com>2021-07-19 13:26:57 +0200
committerCommit Bot <commit-bot@chromium.org>2021-07-26 17:54:46 +0000
commit201a9710afd383110e86fb9b599a42057855eb71 (patch)
tree3e2bb43e2a3b998b9d3dd21f2af949c66880d1fa /board/hatch_fp/fpsensor_detect_rw.c
parentbedaebbb05b921331fcac3bb1561e9cb902e663e (diff)
downloadchrome-ec-201a9710afd383110e86fb9b599a42057855eb71.tar.gz
hatch_fp/board_rw: Set DIVIDER_HIGHSIDE to 1 during board init
On dragonclaw, setting GPIO_DIVIDER_HIGHSIDE to 1 is necessary to enable communication with FP sensor. Until now it was enabled during fp_sensor_init() which was called from fp_task() only in private build (when HAVE_FP_PRIVATE_DRIVER is defined). This was causing problems with fpsensor_hw hardware unittest, which is public build. The problem was solved by enabling GPIO_DIVIDER_HIGHSIDE in configure_fp_sensor_spi(). This approach also required to change get_fp_sensor_type() function to leave GPIO pin enabled. BUG=b:170432597 BRANCH=none TEST=./test/run_device_tests.py --board bloonchipper --tests fpsensor_hw Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: I9cf50ef1377da2dec57d73f9e1374928da86481d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3034857 Reviewed-by: Craig Hesling <hesling@chromium.org>
Diffstat (limited to 'board/hatch_fp/fpsensor_detect_rw.c')
-rw-r--r--board/hatch_fp/fpsensor_detect_rw.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/board/hatch_fp/fpsensor_detect_rw.c b/board/hatch_fp/fpsensor_detect_rw.c
index 85ace2c679..274cfee054 100644
--- a/board/hatch_fp/fpsensor_detect_rw.c
+++ b/board/hatch_fp/fpsensor_detect_rw.c
@@ -24,7 +24,11 @@ enum fp_sensor_type get_fp_sensor_type(void)
ret = FP_SENSOR_TYPE_UNKNOWN;
break;
}
- gpio_set_level(GPIO_DIVIDER_HIGHSIDE, 0);
+ /* We leave GPIO_DIVIDER_HIGHSIDE enabled, since the dragonclaw
+ * development board use it to enable the AND gate (U10) to CS.
+ * Production boards could disable this to save power since it's
+ * only needed for initial detection on those boards.
+ */
return ret;
}