From a2e7b77b3b62d9f663eb1f916fe9ab36bef06dbe Mon Sep 17 00:00:00 2001 From: Yuval Peress Date: Mon, 15 Jul 2019 11:40:47 -0600 Subject: common: Move fifo logic out of motion_sense.c This change is needed to allow better testing of the fifo behavior. Additionally, motion_sense_fifo.c will only be compiled if CONFIG_ACCEL_FIFO is defined. This behaviour requires a few small changes to several boards and baseboards to make sure that we only define CONFIG_ACCEL_FIFO when the MOTIONSENSE task is present (some times that may be only in one section RW or RO). BUG=b:137758297 BRANCH=None TEST=buildall and ran CTS on arcada Change-Id: I2f7e4e436ba9568a35b7a0b2c8d53a73f198ba73 Signed-off-by: Yuval Peress Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1704163 Reviewed-by: Alexandru M Stan Commit-Queue: Alexandru M Stan --- board/kukui/board.c | 4 ++-- board/kukui/board.h | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'board/kukui') diff --git a/board/kukui/board.c b/board/kukui/board.c index 3d7b514a71..8f54d78f3b 100644 --- a/board/kukui/board.c +++ b/board/kukui/board.c @@ -306,7 +306,7 @@ DECLARE_HOOK(HOOK_INIT, board_rev_init, HOOK_PRIO_INIT_ADC + 1); /* Motion sensors */ /* Mutexes */ -#ifdef SECTION_IS_RW +#ifndef VARIANT_KUKUI_NO_SENSORS static struct mutex g_lid_mutex; static struct bmi160_drv_data_t g_bmi160_data; @@ -486,7 +486,7 @@ const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors); const struct motion_sensor_t *motion_als_sensors[] = { &motion_sensors[CLEAR_ALS], }; -#endif /* SECTION_IS_RW */ +#endif /* VARIANT_KUKUI_NO_SENSORS */ void usb_charger_set_switches(int port, enum usb_switch setting) { diff --git a/board/kukui/board.h b/board/kukui/board.h index c017dc6c8c..4fd1a76a50 100644 --- a/board/kukui/board.h +++ b/board/kukui/board.h @@ -17,6 +17,10 @@ #define VARIANT_KUKUI_CHARGER_MT6370 #define VARIANT_KUKUI_DP_MUX_GPIO +#ifndef SECTION_IS_RW +#define VARIANT_KUKUI_NO_SENSORS +#endif /* SECTION_IS_RW */ + #include "baseboard.h" #define CONFIG_VOLUME_BUTTONS -- cgit v1.2.1