summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Boichat <drinkcat@chromium.org>2018-01-11 11:16:14 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-01-11 22:22:45 -0800
commit7fbf25c0969c220e49570f67a8c32783ab23273b (patch)
tree2486b6627304ecac6a1727cb184c3f2b5928340a
parentbdddd6fc1856b0ae1830cd693cf6f4f24bbbba1d (diff)
downloadchrome-ec-7fbf25c0969c220e49570f67a8c32783ab23273b.tar.gz
config.h: Define CONFIG_EC_EC_COMM_BATTERY_MASTER/SLAVE
Instead of defining these options in other header files, set them here. This also prevents pre-submit checks from complaining about these symbols being used without being defined in config.h. BRANCH=none BUG=b:65697962 TEST=make buildall -j, presubmit checks pass for CL that makes use of CONFIG_EC_EC_COMM_BATTERY_MASTER. Change-Id: I8098a8ae6422bf0ffb26523785d7c16a3ee1c6df Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/861365 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--include/config.h14
-rw-r--r--include/ec_ec_comm_master.h4
-rw-r--r--include/ec_ec_comm_slave.h4
3 files changed, 14 insertions, 8 deletions
diff --git a/include/config.h b/include/config.h
index 918c6ceb54..46705f89e3 100644
--- a/include/config.h
+++ b/include/config.h
@@ -3236,6 +3236,20 @@
/*****************************************************************************/
/*
+ * Define derived configuration options for EC-EC communication
+ */
+#ifdef CONFIG_EC_EC_COMM_BATTERY
+#ifdef CONFIG_EC_EC_COMM_MASTER
+#define CONFIG_EC_EC_COMM_BATTERY_MASTER
+#endif
+
+#ifdef CONFIG_EC_EC_COMM_SLAVE
+#define CONFIG_EC_EC_COMM_BATTERY_SLAVE
+#endif
+#endif /* CONFIG_EC_EC_COMM_BATTERY */
+
+/*****************************************************************************/
+/*
* Handle task-dependent configs.
*
* This prevent sub-modules from being compiled when the task and parent module
diff --git a/include/ec_ec_comm_master.h b/include/ec_ec_comm_master.h
index 8c04795103..98b8011b95 100644
--- a/include/ec_ec_comm_master.h
+++ b/include/ec_ec_comm_master.h
@@ -11,10 +11,6 @@
#include <stdint.h>
#include "config.h"
-#if defined(CONFIG_EC_EC_COMM_MASTER) && defined(CONFIG_EC_EC_COMM_BATTERY)
-#define CONFIG_EC_EC_COMM_BATTERY_MASTER
-#endif
-
/*
* TODO(b:65697620): Move these to some other C file, depending on a config
* option.
diff --git a/include/ec_ec_comm_slave.h b/include/ec_ec_comm_slave.h
index 1954018319..e3501400e2 100644
--- a/include/ec_ec_comm_slave.h
+++ b/include/ec_ec_comm_slave.h
@@ -12,10 +12,6 @@
#include "consumer.h"
#include "queue.h"
-#if defined(CONFIG_EC_EC_COMM_SLAVE) && defined(CONFIG_EC_EC_COMM_BATTERY)
-#define CONFIG_EC_EC_COMM_BATTERY_SLAVE
-#endif
-
/* TODO(b:65697620): Move these to battery.h, depending on a config option. */
extern struct ec_response_battery_static_info base_battery_static;
extern struct ec_response_battery_dynamic_info base_battery_dynamic;