From 89eef55718e6eb9164dfedae7ce11d6250a4bc5a Mon Sep 17 00:00:00 2001 From: Rajat Jain Date: Fri, 10 Apr 2020 15:48:49 -0700 Subject: google/chromeec: Add wrapper for EC_CMD_GET_KEYBD_CONFIG Add a wrapper command for the subject command Signed-off-by: Rajat Jain Change-Id: I29a4021c2ea0d1cbb4a72f56bf2232d8f9c80ac3 Reviewed-on: https://review.coreboot.org/c/coreboot/+/40313 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak --- src/ec/google/chromeec/ec.c | 18 ++++++++++++++++++ src/ec/google/chromeec/ec.h | 8 ++++++++ 2 files changed, 26 insertions(+) (limited to 'src') diff --git a/src/ec/google/chromeec/ec.c b/src/ec/google/chromeec/ec.c index 73baec63be..1c1f42ec62 100644 --- a/src/ec/google/chromeec/ec.c +++ b/src/ec/google/chromeec/ec.c @@ -1518,3 +1518,21 @@ int google_chromeec_wait_for_displayport(long timeout) return 1; } + +int google_chromeec_get_keybd_config(struct ec_response_keybd_config *keybd) +{ + struct chromeec_command cmd = { + .cmd_code = EC_CMD_GET_KEYBD_CONFIG, + .cmd_version = 0, + .cmd_data_in = NULL, + .cmd_size_in = 0, + .cmd_data_out = keybd, + .cmd_size_out = sizeof(*keybd), + .cmd_dev_index = 0, + }; + + if (google_chromeec_command(&cmd)) + return -1; + + return 0; +} diff --git a/src/ec/google/chromeec/ec.h b/src/ec/google/chromeec/ec.h index 64d7e52981..5f84722ac7 100644 --- a/src/ec/google/chromeec/ec.h +++ b/src/ec/google/chromeec/ec.h @@ -330,6 +330,14 @@ struct usb_pd_port_caps { int google_chromeec_get_pd_port_caps(int port, struct usb_pd_port_caps *port_caps); +/** + * Get the keyboard configuration / layout information from EC + * + * @param *keybd If successful, this is filled with EC filled parameters + * @return 0 on success, -1 on error + */ +int google_chromeec_get_keybd_config(struct ec_response_keybd_config *keybd); + #if CONFIG(HAVE_ACPI_TABLES) /** * Writes USB Type-C PD related information to the SSDT -- cgit v1.2.3