summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlec Berg <alecaberg@chromium.org>2014-11-21 15:43:56 -0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-11-22 09:33:40 +0000
commitbebce8dca1fe3625b789f82ae171c254f0ae413d (patch)
tree4cbbbffd7ebf7cad059ca4c3433e4d601b402ccf
parent446002d2f86db9329923da80a1425d4d66a6289c (diff)
downloadchrome-ec-bebce8dca1fe3625b789f82ae171c254f0ae413d.tar.gz
samus_pd: remove host event commands module to save flash space
Remove host_event_commands.c from build to save flash space. The PD MCU does not use host event infrastructure and instead has a simple gpio line it uses to notify EC that it has info to share. BUG=none BRANCH=samus TEST=make buildall. view the .map file and see we save about 700 bytes of flash. Change-Id: I71b8a4e32b9ecb57eb1a57f6d28652476ee6afe6 Signed-off-by: Alec Berg <alecaberg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/231444 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/samus_pd/board.h1
-rw-r--r--common/build.mk7
-rw-r--r--common/host_command.c2
-rw-r--r--include/config.h7
4 files changed, 14 insertions, 3 deletions
diff --git a/board/samus_pd/board.h b/board/samus_pd/board.h
index 19a68e4867..b0cc958286 100644
--- a/board/samus_pd/board.h
+++ b/board/samus_pd/board.h
@@ -24,6 +24,7 @@
#undef CONFIG_CONSOLE_CMDHELP
#define CONFIG_FORCE_CONSOLE_RESUME
#define CONFIG_HIBERNATE_WAKEUP_PINS (STM32_PWR_CSR_EWUP3|STM32_PWR_CSR_EWUP8)
+#undef CONFIG_HOSTCMD_EVENTS
#define CONFIG_HW_CRC
#define CONFIG_I2C
#undef CONFIG_LID_SWITCH
diff --git a/common/build.mk b/common/build.mk
index e304756895..97e270f8f7 100644
--- a/common/build.mk
+++ b/common/build.mk
@@ -45,6 +45,8 @@ common-$(CONFIG_EXTPOWER_SPRING)+=extpower_spring.o
common-$(CONFIG_FANS)+=fan.o
common-$(CONFIG_FLASH)+=flash.o
common-$(CONFIG_FMAP)+=fmap.o
+common-$(CONFIG_GESTURE_DETECTION)+=gesture.o
+common-$(CONFIG_HOSTCMD_EVENTS)+=host_event_commands.o
common-$(CONFIG_I2C)+=i2c.o
common-$(CONFIG_I2C_ARBITRATION)+=i2c_arbitration.o
common-$(CONFIG_INDUCTIVE_CHARGING)+=inductive_charging.o
@@ -52,6 +54,7 @@ common-$(CONFIG_KEYBOARD_PROTOCOL_8042)+=keyboard_8042.o
common-$(CONFIG_KEYBOARD_PROTOCOL_MKBP)+=keyboard_mkbp.o
common-$(CONFIG_KEYBOARD_TEST)+=keyboard_test.o
common-$(CONFIG_LED_COMMON)+=led_common.o
+common-$(CONFIG_LID_ANGLE)+=motion_lid.o
common-$(CONFIG_LID_ANGLE_KEY_SCAN)+=lid_angle.o
common-$(CONFIG_LID_SWITCH)+=lid_switch.o
common-$(CONFIG_LPC)+=acpi.o port80.o
@@ -80,11 +83,9 @@ common-$(CONFIG_WIRELESS)+=wireless.o
common-$(HAS_TASK_CHIPSET)+=chipset.o
common-$(HAS_TASK_CONSOLE)+=console.o console_output.o uart_buffering.o
common-$(HAS_TASK_CONSOLE)+=memory_commands.o
-common-$(HAS_TASK_HOSTCMD)+=host_command.o host_event_commands.o
+common-$(HAS_TASK_HOSTCMD)+=host_command.o
common-$(HAS_TASK_PDCMD)+=host_command_master.o host_command_pd.o
common-$(HAS_TASK_KEYSCAN)+=keyboard_scan.o
common-$(HAS_TASK_LIGHTBAR)+=lb_common.o lightbar.o
common-$(HAS_TASK_MOTIONSENSE)+=motion_sense.o math_util.o
-common-$(CONFIG_GESTURE_DETECTION)+=gesture.o
-common-$(CONFIG_LID_ANGLE)+=motion_lid.o
common-$(TEST_BUILD)+=test_util.o
diff --git a/common/host_command.c b/common/host_command.c
index de570284f6..6a1ab2d6ff 100644
--- a/common/host_command.c
+++ b/common/host_command.c
@@ -379,8 +379,10 @@ static void host_command_init(void)
*host_get_memmap(EC_MEMMAP_ID_VERSION) = 1;
*host_get_memmap(EC_MEMMAP_EVENTS_VERSION) = 1;
+#ifdef CONFIG_HOSTCMD_EVENTS
host_set_single_event(EC_HOST_EVENT_INTERFACE_READY);
CPRINTS("hostcmd init 0x%x", host_get_events());
+#endif
}
void host_command_task(void)
diff --git a/include/config.h b/include/config.h
index c1f2b24198..c4b07090c1 100644
--- a/include/config.h
+++ b/include/config.h
@@ -611,6 +611,13 @@
*/
#undef CONFIG_HOSTCMD_I2C_SLAVE_ADDR
+/* If we have host command task, assume we also are using host events. */
+#ifdef HAS_TASK_HOSTCMD
+#define CONFIG_HOSTCMD_EVENTS
+#else
+#undef CONFIG_HOSTCMD_EVENTS
+#endif
+
/*****************************************************************************/
/* Enable debugging and profiling statistics for hook functions */