summaryrefslogtreecommitdiff
path: root/baseboard
diff options
context:
space:
mode:
authorYuval Peress <peress@chromium.org>2019-07-15 14:10:11 -0600
committerCommit Bot <commit-bot@chromium.org>2019-09-03 20:36:04 +0000
commitdfbc632cd5b5a856086249253a98bc83d8942a29 (patch)
tree9f0359115a96ca0efe66905b5f6b1be644367430 /baseboard
parent083788ac19505f07bfe57a4d8b54a3b11b7554b3 (diff)
downloadchrome-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 'baseboard')
-rw-r--r--baseboard/grunt/baseboard.h7
-rw-r--r--baseboard/hatch/baseboard.h6
-rw-r--r--baseboard/kukui/baseboard.h7
-rw-r--r--baseboard/octopus/baseboard.h6
-rw-r--r--baseboard/zork/baseboard.h7
5 files changed, 20 insertions, 13 deletions
diff --git a/baseboard/grunt/baseboard.h b/baseboard/grunt/baseboard.h
index 27d87091b2..e2fd994649 100644
--- a/baseboard/grunt/baseboard.h
+++ b/baseboard/grunt/baseboard.h
@@ -186,11 +186,12 @@
#define CONFIG_TEMP_SENSOR_SB_TSI
#ifndef VARIANT_GRUNT_NO_SENSORS
+/* 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 256
-
+#define CONFIG_ACCEL_FIFO_SIZE 256
/* 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)
#endif /* VARIANT_GRUNT_NO_SENSORS */
#define USB_PD_PORT_ANX74XX 0
diff --git a/baseboard/hatch/baseboard.h b/baseboard/hatch/baseboard.h
index dac40e9293..a7f352e736 100644
--- a/baseboard/hatch/baseboard.h
+++ b/baseboard/hatch/baseboard.h
@@ -72,10 +72,12 @@
/* I2C_PORT_ACCEL needs to be defined for i2c transactions */
#define I2C_PORT_ACCEL I2C_PORT_SENSOR
+/* 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 (CONFIG_ACCEL_FIFO / 3)
+#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3)
/* Sensor console commands */
#define CONFIG_CMD_ACCELS
diff --git a/baseboard/kukui/baseboard.h b/baseboard/kukui/baseboard.h
index 317c51be51..b22b1cdf01 100644
--- a/baseboard/kukui/baseboard.h
+++ b/baseboard/kukui/baseboard.h
@@ -139,10 +139,11 @@
#define CONFIG_TABLET_MODE_SWITCH
#define GPIO_LID_OPEN GPIO_HALL_INT_L
-/* FIFO size is in power of 2. */
#ifndef VARIANT_KUKUI_NO_SENSORS
-#define CONFIG_ACCEL_FIFO 256
-#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO / 3)
+#define CONFIG_ACCEL_FIFO
+/* FIFO size is in power of 2. */
+#define CONFIG_ACCEL_FIFO_SIZE 256
+#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3)
#endif /* VARIANT_KUKUI_NO_SENSORS */
/* USB PD config */
diff --git a/baseboard/octopus/baseboard.h b/baseboard/octopus/baseboard.h
index 32210a0ed1..a8e613b0e2 100644
--- a/baseboard/octopus/baseboard.h
+++ b/baseboard/octopus/baseboard.h
@@ -275,10 +275,12 @@
* and the lid sensor is polled real-time (in forced mode).
*/
#define CONFIG_ACCEL_INTERRUPTS
+/* Enable sensor fifo, must also define the _SIZE and _THRES */
+#define CONFIG_ACCEL_FIFO
/* Power of 2 - Too large of a fifo causes too much timestamp jitter */
-#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 (CONFIG_ACCEL_FIFO / 3)
+#define CONFIG_ACCEL_FIFO_THRES (CONFIG_ACCEL_FIFO_SIZE / 3)
#endif /* VARIANT_OCTOPUS_NO_SENSORS */
/*
diff --git a/baseboard/zork/baseboard.h b/baseboard/zork/baseboard.h
index 362a8d2fc0..c7f706c2af 100644
--- a/baseboard/zork/baseboard.h
+++ b/baseboard/zork/baseboard.h
@@ -196,11 +196,12 @@
/* Thermal */
#define CONFIG_TEMP_SENSOR_SB_TSI
+/* 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 256
-
+#define CONFIG_ACCEL_FIFO_SIZE 256
/* 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__