summaryrefslogtreecommitdiff
path: root/common/system.c
diff options
context:
space:
mode:
authorparis_yeh <pyeh@google.com>2018-06-01 16:15:24 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-06-20 14:23:49 -0700
commit5d825c5c9b9b805b2677b13a891a7edce0802e69 (patch)
treeb2d65413008ec901575e8c291ae338600cf2f87d /common/system.c
parent7fdaa393dfd0b4da381f62ee50e4b1c056d6eda4 (diff)
downloadchrome-ec-5d825c5c9b9b805b2677b13a891a7edce0802e69.tar.gz
ec/google: Add command to fetch keyboard ID from EC
Sort k-prefix host commands and descriptions in alphabetical order BRANCH=master BUG=b:80168723 TEST=Check 'ectool kbid' on a reworked DUT using keyboard samples Change-Id: If2ad654e5ef269d03365db7c3286c2281aa9d9ef Signed-off-by: paris_yeh <pyeh@google.com> Reviewed-on: https://chromium-review.googlesource.com/1097997 Commit-Ready: Paris Yeh <pyeh@chromium.org> Tested-by: Paris Yeh <pyeh@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Paris Yeh <pyeh@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'common/system.c')
-rw-r--r--common/system.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/common/system.c b/common/system.c
index aa3e48db34..926d9aa11d 100644
--- a/common/system.c
+++ b/common/system.c
@@ -17,6 +17,7 @@
#include "hooks.h"
#include "host_command.h"
#include "i2c.h"
+#include "keyboard_scan.h"
#include "lpc.h"
#include "otp.h"
#include "rwsig.h"
@@ -1367,6 +1368,21 @@ DECLARE_HOST_COMMAND(EC_CMD_SET_SKU_ID,
EC_VER_MASK(0));
#endif
+#ifdef CONFIG_KEYBOARD_LANGUAGE_ID
+static int host_command_get_keyboard_id(struct host_cmd_handler_args *args)
+{
+ struct ec_response_keyboard_id *r = args->response;
+
+ r->keyboard_id = keyboard_get_keyboard_id();
+ args->response_size = sizeof(*r);
+
+ return EC_RES_SUCCESS;
+}
+DECLARE_HOST_COMMAND(EC_CMD_GET_KEYBOARD_ID,
+ host_command_get_keyboard_id,
+ EC_VER_MASK(0));
+#endif
+
static int host_command_build_info(struct host_cmd_handler_args *args)
{
strzcpy(args->response, system_get_build_info(), args->response_max);