diff options
author | Yuval Peress <peress@chromium.org> | 2019-07-15 14:10:11 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-09-03 20:36:04 +0000 |
commit | dfbc632cd5b5a856086249253a98bc83d8942a29 (patch) | |
tree | 9f0359115a96ca0efe66905b5f6b1be644367430 /board | |
parent | 083788ac19505f07bfe57a4d8b54a3b11b7554b3 (diff) | |
download | chrome-ec-dfbc632cd5b5a856086249253a98bc83d8942a29.tar.gz |
config: Refactor CONFIG_ACCEL_FIFO to enable use of IS_ENABLED
This change allows us to use the IS_ENABLED condition to replace
the various ifdef guards around the CONFIG_ACCEL_FIFO
BUG=b:137758297,chromium:981990
BRANCH=None
TEST=buildall and CTS tests on Arcada
Change-Id: I65d36bac19855e51c830a33e6f3812575e8d15d9
Signed-off-by: Yuval Peress <peress@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1704164
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/arcada_ish/board.h | 8 | ||||
-rw-r--r-- | board/atlas/board.h | 8 | ||||
-rw-r--r-- | board/cheza/board.h | 8 | ||||
-rw-r--r-- | board/coral/board.h | 7 | ||||
-rw-r--r-- | board/eve/board.h | 7 | ||||
-rw-r--r-- | board/flapjack/board.h | 11 | ||||
-rw-r--r-- | board/nami/board.h | 7 | ||||
-rw-r--r-- | board/nautilus/board.h | 7 | ||||
-rw-r--r-- | board/nocturne/board.h | 7 | ||||
-rw-r--r-- | board/poppy/board.h | 7 | ||||
-rw-r--r-- | board/rainier/board.h | 7 | ||||
-rw-r--r-- | board/rammus/board.h | 7 | ||||
-rw-r--r-- | board/reef/board.h | 7 | ||||
-rw-r--r-- | board/reef_mchp/board.h | 7 | ||||
-rw-r--r-- | board/scarlet/board.h | 5 |
15 files changed, 73 insertions, 37 deletions
diff --git a/board/arcada_ish/board.h b/board/arcada_ish/board.h index 18bdf6258a..f036bfd301 100644 --- a/board/arcada_ish/board.h +++ b/board/arcada_ish/board.h @@ -34,8 +34,12 @@ #define CONFIG_MAG_CALIBRATE #define CONFIG_ACCEL_INTERRUPTS -#define CONFIG_ACCEL_FIFO 256 -#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3) +/* Enable sensor fifo, must also define the _SIZE and _THRES */ +#define CONFIG_ACCEL_FIFO +/* FIFO size is a power of 2. */ +#define CONFIG_ACCEL_FIFO_SIZE 256 +/* Depends on how fast the AP boots and typical ODRs. */ +#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3) /* Sensors without hardware FIFO are in forced mode */ #define CONFIG_ACCEL_FORCE_MODE_MASK (BIT(BASE_ACCEL) | BIT(LID_MAG)) diff --git a/board/atlas/board.h b/board/atlas/board.h index 37d8c5afd1..2d35762b0f 100644 --- a/board/atlas/board.h +++ b/board/atlas/board.h @@ -114,8 +114,12 @@ #define CONFIG_ALS_OPT3001 #define ALS_COUNT 1 #define OPT3001_I2C_ADDR_FLAGS OPT3001_I2C_ADDR1_FLAGS -#define CONFIG_ACCEL_FIFO 1024 -#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3) +/* Enable sensor fifo, must also define the _SIZE and _THRES */ +#define CONFIG_ACCEL_FIFO +/* FIFO size is a power of 2. */ +#define CONFIG_ACCEL_FIFO_SIZE 1024 +/* Depends on how fast the AP boots and typical ODRs. */ +#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3) #define CONFIG_ACCEL_INTERRUPTS /* USB */ diff --git a/board/cheza/board.h b/board/cheza/board.h index 39adbcf500..b7c4131529 100644 --- a/board/cheza/board.h +++ b/board/cheza/board.h @@ -131,8 +131,12 @@ #define CONFIG_ACCEL_INTERRUPTS #define CONFIG_ACCELGYRO_BMI160_INT_EVENT \ TASK_EVENT_MOTION_SENSOR_INTERRUPT(LID_ACCEL) -#define CONFIG_ACCEL_FIFO 512 -#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3) +/* Enable sensor fifo, must also define the _SIZE and _THRES */ +#define CONFIG_ACCEL_FIFO +/* FIFO size is a power of 2. */ +#define CONFIG_ACCEL_FIFO_SIZE 256 +/* Depends on how fast the AP boots and typical ODRs. */ +#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3) #define CONFIG_CMD_ACCELS #define CONFIG_CMD_ACCEL_INFO #define CONFIG_ALS diff --git a/board/coral/board.h b/board/coral/board.h index 8a84cbb062..29afbd44ce 100644 --- a/board/coral/board.h +++ b/board/coral/board.h @@ -207,11 +207,12 @@ #define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL #define CONFIG_DYNAMIC_MOTION_SENSOR_COUNT +/* Enable sensor fifo, must also define the _SIZE and _THRES */ +#define CONFIG_ACCEL_FIFO /* FIFO size is in power of 2. */ -#define CONFIG_ACCEL_FIFO 512 - +#define CONFIG_ACCEL_FIFO_SIZE 512 /* Depends on how fast the AP boots and typical ODRs */ -#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3) +#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3) #ifndef __ASSEMBLER__ diff --git a/board/eve/board.h b/board/eve/board.h index 642db72eb3..ac4e80ce04 100644 --- a/board/eve/board.h +++ b/board/eve/board.h @@ -136,11 +136,12 @@ #define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL #define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL +/* Enable sensor fifo, must also define the _SIZE and _THRES */ +#define CONFIG_ACCEL_FIFO /* FIFO size is in power of 2. */ -#define CONFIG_ACCEL_FIFO 512 - +#define CONFIG_ACCEL_FIFO_SIZE 512 /* Depends on how fast the AP boots and typical ODRs */ -#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3) +#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3) /* Enable double tap detection */ #define CONFIG_GESTURE_DETECTION diff --git a/board/flapjack/board.h b/board/flapjack/board.h index a7420a55eb..353f3a62b3 100644 --- a/board/flapjack/board.h +++ b/board/flapjack/board.h @@ -114,10 +114,17 @@ #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH +/* + * Only include the sensor fifo in the RW section (since the motion task is only + * included there). + */ #ifdef SECTION_IS_RW +/* Enable sensor fifo, must also define the _SIZE and _THRES */ +#define CONFIG_ACCEL_FIFO /* FIFO size is in power of 2. */ -#define CONFIG_ACCEL_FIFO 256 -#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3) +#define CONFIG_ACCEL_FIFO_SIZE 256 +/* Depends on how fast the AP boots and typical ODRs. */ +#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3) #endif /* SECTION_IS_RW */ /* Wireless Power Charger Config */ diff --git a/board/nami/board.h b/board/nami/board.h index 2a93975747..cfcc6b3d2e 100644 --- a/board/nami/board.h +++ b/board/nami/board.h @@ -148,11 +148,12 @@ /* KB backlight driver */ #define CONFIG_LED_DRIVER_LM3509 +/* Enable sensor fifo, must also define the _SIZE and _THRES */ +#define CONFIG_ACCEL_FIFO /* FIFO size is in power of 2. */ -#define CONFIG_ACCEL_FIFO 512 - +#define CONFIG_ACCEL_FIFO_SIZE 512 /* Depends on how fast the AP boots and typical ODRs */ -#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3) +#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3) #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH diff --git a/board/nautilus/board.h b/board/nautilus/board.h index 30b21ef9f1..59f2b395ac 100644 --- a/board/nautilus/board.h +++ b/board/nautilus/board.h @@ -123,11 +123,12 @@ #define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL #define CONFIG_LID_ANGLE_UPDATE +/* Enable sensor fifo, must also define the _SIZE and _THRES */ +#define CONFIG_ACCEL_FIFO /* FIFO size is in power of 2. */ -#define CONFIG_ACCEL_FIFO 512 - +#define CONFIG_ACCEL_FIFO_SIZE 512 /* Depends on how fast the AP boots and typical ODRs */ -#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3) +#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3) #undef CONFIG_UART_TX_BUF_SIZE #define CONFIG_UART_TX_BUF_SIZE 2048 diff --git a/board/nocturne/board.h b/board/nocturne/board.h index 3186090f20..f969a5f03d 100644 --- a/board/nocturne/board.h +++ b/board/nocturne/board.h @@ -94,9 +94,12 @@ #define ALS_COUNT 1 #define CONFIG_ALS_OPT3001 #define OPT3001_I2C_ADDR_FLAGS OPT3001_I2C_ADDR1_FLAGS -#define CONFIG_ACCEL_FIFO 512 /* Must be a power of 2 */ +/* Enable sensor fifo, must also define the _SIZE and _THRES */ +#define CONFIG_ACCEL_FIFO +/* Must be a power of 2 */ +#define CONFIG_ACCEL_FIFO_SIZE 512 /* Depends on how fast the AP boots and typical ODRs */ -#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3) +#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3) #define CONFIG_ACCEL_INTERRUPTS #define CONFIG_ACCELGYRO_BMI160 #define CONFIG_ACCELGYRO_BMI160_INT_EVENT \ diff --git a/board/poppy/board.h b/board/poppy/board.h index 36055bb1cc..104c77962a 100644 --- a/board/poppy/board.h +++ b/board/poppy/board.h @@ -133,11 +133,12 @@ /* Lower maximal ODR to 100Hz */ #define CONFIG_EC_MAX_SENSOR_FREQ_MILLIHZ 100000 +/* Enable sensor fifo, must also define the _SIZE and _THRES */ +#define CONFIG_ACCEL_FIFO /* FIFO size is in power of 2. */ -#define CONFIG_ACCEL_FIFO 512 - +#define CONFIG_ACCEL_FIFO_SIZE 512 /* Depends on how fast the AP boots and typical ODRs */ -#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3) +#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3) #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH diff --git a/board/rainier/board.h b/board/rainier/board.h index 3827f97ea6..fe633e12b3 100644 --- a/board/rainier/board.h +++ b/board/rainier/board.h @@ -77,9 +77,12 @@ #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH +/* Enable sensor fifo, must also define the _SIZE and _THRES */ +#define CONFIG_ACCEL_FIFO /* FIFO size is in power of 2. */ -#define CONFIG_ACCEL_FIFO 256 -#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3) +#define CONFIG_ACCEL_FIFO_SIZE 256 +/* Depends on how fast the AP boots and typical ODRs. */ +#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3) /* Sensors without hardware FIFO are in forced mode. */ #define CONFIG_ACCEL_FORCE_MODE_MASK BIT(LID_BARO) diff --git a/board/rammus/board.h b/board/rammus/board.h index da73f7acd4..1a8944e1ef 100644 --- a/board/rammus/board.h +++ b/board/rammus/board.h @@ -122,11 +122,12 @@ #undef CONFIG_SENSOR_TIGHT_TIMESTAMPS +/* Enable sensor fifo, must also define the _SIZE and _THRES */ +#define CONFIG_ACCEL_FIFO /* FIFO size is in power of 2. */ -#define CONFIG_ACCEL_FIFO 512 - +#define CONFIG_ACCEL_FIFO_SIZE 512 /* Depends on how fast the AP boots and typical ODRs */ -#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3) +#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3) #undef CONFIG_UART_TX_BUF_SIZE #define CONFIG_UART_TX_BUF_SIZE 2048 diff --git a/board/reef/board.h b/board/reef/board.h index d3493e347f..72f2818a23 100644 --- a/board/reef/board.h +++ b/board/reef/board.h @@ -206,11 +206,12 @@ #define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL #define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL +/* Enable sensor fifo, must also define the _SIZE and _THRES */ +#define CONFIG_ACCEL_FIFO /* FIFO size is in power of 2. */ -#define CONFIG_ACCEL_FIFO 512 - +#define CONFIG_ACCEL_FIFO_SIZE 512 /* Depends on how fast the AP boots and typical ODRs */ -#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3) +#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3) #ifndef __ASSEMBLER__ diff --git a/board/reef_mchp/board.h b/board/reef_mchp/board.h index 3befb5bf05..348375e8da 100644 --- a/board/reef_mchp/board.h +++ b/board/reef_mchp/board.h @@ -213,11 +213,12 @@ #define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL #define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL +/* Enable sensor fifo, must also define the _SIZE and _THRES */ +#define CONFIG_ACCEL_FIFO /* FIFO size is in power of 2. */ -#define CONFIG_ACCEL_FIFO 1024 - +#define CONFIG_ACCEL_FIFO_SIZE 1024 /* Depends on how fast the AP boots and typical ODRs */ -#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3) +#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3) #ifndef __ASSEMBLER__ diff --git a/board/scarlet/board.h b/board/scarlet/board.h index 5187ac4eb8..901514f29f 100644 --- a/board/scarlet/board.h +++ b/board/scarlet/board.h @@ -99,8 +99,11 @@ #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH +/* Enable sensor fifo, must also define the _SIZE and _THRES */ +#define CONFIG_ACCEL_FIFO /* FIFO size is in power of 2. */ -#define CONFIG_ACCEL_FIFO 256 +#define CONFIG_ACCEL_FIFO_SIZE 256 +/* Depends on how fast the AP boots and typical ODRs. */ #define CONFIG_ACCEL_FIFO_THRES 10 /* USB PD config */ |