summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2018-01-18 17:02:11 +0100
committerchrome-bot <chrome-bot@chromium.org>2018-01-18 17:40:02 -0800
commitf8825cef150365a70e49464089f0133a418a9c9f (patch)
tree179ba82373a5ce731cd72d75bf8a6d7997b568d6
parent60bbe1ca75ae49d9cd48a61327f9161a9174a801 (diff)
downloadchrome-ec-f8825cef150365a70e49464089f0133a418a9c9f.tar.gz
fpsensor: fix test build
Disable the private fp driver calls for test binaries. Signed-off-by: Vincent Palatin <vpalatin@chromium.org> BRANCH=none BUG=b:70320279 TEST=make BOARD=meowth_fp tests Change-Id: I16f241a33ead3ea29e7aa955512e05e679a0c551 Reviewed-on: https://chromium-review.googlesource.com/873923 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--common/fpsensor.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/common/fpsensor.c b/common/fpsensor.c
index 50057ca3e6..f2b7e07d00 100644
--- a/common/fpsensor.c
+++ b/common/fpsensor.c
@@ -17,7 +17,8 @@
#include "timer.h"
#include "util.h"
#include "watchdog.h"
-#ifdef HAVE_PRIVATE
+#if defined(HAVE_PRIVATE) && !defined(TEST_BUILD)
+#define HAVE_FP_PRIVATE_DRIVER
#define PRIV_HEADER(header) STRINGIFY(header)
#include PRIV_HEADER(FP_SENSOR_PRIVATE)
#else
@@ -66,7 +67,7 @@ void fp_task(void)
gpio_config_module(MODULE_SPI_MASTER, 1);
spi_enable(CONFIG_SPI_FP_PORT, 1);
-#ifdef HAVE_PRIVATE
+#ifdef HAVE_FP_PRIVATE_DRIVER
/* Reset and initialize the sensor IC */
fp_sensor_init();
@@ -125,13 +126,13 @@ void fp_task(void)
}
}
}
-#else /* !HAVE_PRIVATE */
+#else /* !HAVE_FP_PRIVATE_DRIVER */
while (1) {
uint32_t evt = task_wait_event(timeout_us);
send_mkbp_event(evt);
}
-#endif /* !HAVE_PRIVATE */
+#endif /* !HAVE_FP_PRIVATE_DRIVER */
}
static int fp_get_next_event(uint8_t *out)
@@ -205,7 +206,7 @@ static int fp_command_info(struct host_cmd_handler_args *args)
{
struct ec_response_fp_info *r = args->response;
-#ifdef HAVE_PRIVATE
+#ifdef HAVE_FP_PRIVATE_DRIVER
if (fp_sensor_get_info(r) < 0)
#endif
return EC_RES_UNAVAILABLE;