summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVijay Hiremath <vijay.p.hiremath@intel.com>2015-08-28 13:42:58 -0700
committerchrome-bot <chrome-bot@chromium.org>2015-08-28 18:09:06 -0700
commit5943f49e17f4164188f0d0947b024e8b4271c00d (patch)
tree2c6aadf6179e2c9d0c34355d2df56cbab3f47574
parent97a1d1671b224b4b6bfda0029edf6c02f932f7a7 (diff)
downloadchrome-ec-5943f49e17f4164188f0d0947b024e8b4271c00d.tar.gz
Keyboard: Add a macro to conditionally compile the console commands
Added macros to conditionally compile the keyboard test console commands to save the memory. These macros can be enabled/disabled in the board specific files. BUG=none TEST=make buildall -j BRANCH=none Change-Id: I3ad190f1f3c9310e4f706b3b23cb8ca8755e49ef Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/295942 Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com> Commit-Ready: Divya Jyothi <divya.jyothi@intel.com> Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Tested-by: Divya Jyothi <divya.jyothi@intel.com> Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Shawn N <shawnn@chromium.org>
-rw-r--r--board/kunimitsu/board.h1
-rw-r--r--common/keyboard_8042.c3
-rw-r--r--common/keyboard_scan.c3
-rw-r--r--include/config.h1
4 files changed, 6 insertions, 2 deletions
diff --git a/board/kunimitsu/board.h b/board/kunimitsu/board.h
index 3149e07f9d..6ea8be6379 100644
--- a/board/kunimitsu/board.h
+++ b/board/kunimitsu/board.h
@@ -111,6 +111,7 @@
#undef CONFIG_CMD_ACCEL_INFO
#undef CONFIG_CMD_ACCELS
#undef CONFIG_CMD_HASH
+#undef CONFIG_CMD_KEYBOARD
#undef CONFIG_CMD_SHMEM
#undef CONFIG_CMD_TEMP_SENSOR
#undef CONFIG_CMD_TIMERINFO
diff --git a/common/keyboard_8042.c b/common/keyboard_8042.c
index 96321e28f3..b4b39008c3 100644
--- a/common/keyboard_8042.c
+++ b/common/keyboard_8042.c
@@ -962,7 +962,7 @@ test_mockable void keyboard_update_button(enum keyboard_button_type button,
/*****************************************************************************/
/* Console commands */
-
+#ifdef CONFIG_CMD_KEYBOARD
static int command_typematic(int argc, char **argv)
{
int i;
@@ -1189,6 +1189,7 @@ DECLARE_CONSOLE_COMMAND(8042, command_8042,
" kblog | kbd]",
"Print 8042 state in one place",
NULL);
+#endif
/*****************************************************************************/
diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c
index e67fe81b1b..5e71554e3f 100644
--- a/common/keyboard_scan.c
+++ b/common/keyboard_scan.c
@@ -713,7 +713,7 @@ DECLARE_HOST_COMMAND(EC_CMD_MKBP_SIMULATE_KEY,
/*****************************************************************************/
/* Console commands */
-
+#ifdef CONFIG_CMD_KEYBOARD
static int command_ksstate(int argc, char **argv)
{
if (argc > 1 && !parse_bool(argv[1], &print_state_changes))
@@ -779,3 +779,4 @@ DECLARE_CONSOLE_COMMAND(kbpress, command_keyboard_press,
"[col row [0 | 1]]",
"Simulate keypress",
NULL);
+#endif
diff --git a/include/config.h b/include/config.h
index 70773848e6..544fcc1ed9 100644
--- a/include/config.h
+++ b/include/config.h
@@ -457,6 +457,7 @@
#define CONFIG_CMD_I2C_XFER
#undef CONFIG_CMD_I2CWEDGE
#define CONFIG_CMD_IDLE_STATS
+#define CONFIG_CMD_KEYBOARD
#undef CONFIG_CMD_ILIM
#define CONFIG_CMD_INA
#define CONFIG_CMD_REGULATOR