summaryrefslogtreecommitdiff
path: root/src/ec/google
diff options
context:
space:
mode:
authorRajat Jain <rajatja@google.com>2020-04-02 23:58:35 -0700
committerFurquan Shaikh <furquan@google.com>2020-04-17 01:07:25 +0000
commitc0495723857792f30b88880fafbe958ce9f700f3 (patch)
tree5db329fe5d97d62a35968707a12b48391c29438d /src/ec/google
parent74bee3c8adb70c8987ea1c174d58682bbf05350a (diff)
downloadcoreboot-c0495723857792f30b88880fafbe958ce9f700f3.tar.xz
ec/google/chromeec: Add host command EC_CMD_GET_KEYBD_CONFIG
Add command to query the EC for the keyboard layout. Also add supporting data structures for the exchange. Signed-off-by: Rajat Jain <rajatja@google.com> Change-Id: I26aff6dd0e701e0cecb3b66bc54c5a23688f0109 Reviewed-on: https://review.coreboot.org/c/coreboot/+/40030 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/ec/google')
-rw-r--r--src/ec/google/chromeec/ec_commands.h77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/ec/google/chromeec/ec_commands.h b/src/ec/google/chromeec/ec_commands.h
index 18be8d30b2..d642d9eb64 100644
--- a/src/ec/google/chromeec/ec_commands.h
+++ b/src/ec/google/chromeec/ec_commands.h
@@ -6079,6 +6079,83 @@ enum keyboard_button_type {
KEYBOARD_BUTTON_COUNT
};
+/*****************************************************************************/
+/*
+ * "Get the Keyboard Config". An EC implementing this command is expected to be
+ * vivaldi capable, i.e. can send action codes for the top row keys.
+ * Additionally, capability to send function codes for the same keys is
+ * optional and acceptable.
+ *
+ * Note: If the top row can generate both function and action codes by
+ * using a dedicated Fn key, it does not matter whether the key sends
+ * "function" or "action" codes by default. In both cases, the response
+ * for this command will look the same.
+ */
+#define EC_CMD_GET_KEYBD_CONFIG 0x012A
+
+/* Possible values for the top row keys */
+enum action_key {
+ TK_ABSENT = 0,
+ TK_BACK = 1,
+ TK_FORWARD = 2,
+ TK_REFRESH = 3,
+ TK_FULLSCREEN = 4,
+ TK_OVERVIEW = 5,
+ TK_BRIGHTNESS_DOWN = 6,
+ TK_BRIGHTNESS_UP = 7,
+ TK_VOL_MUTE = 8,
+ TK_VOL_DOWN = 9,
+ TK_VOL_UP = 10,
+ TK_SNAPSHOT = 11,
+ TK_PRIVACY_SCRN_TOGGLE = 12,
+ TK_KBD_BKLIGHT_DOWN = 13,
+ TK_KBD_BKLIGHT_UP = 14,
+ TK_PLAY_PAUSE = 15,
+ TK_NEXT_TRACK = 16,
+ TK_PREV_TRACK = 17,
+};
+
+/*
+ * Max & Min number of top row keys, excluding Esc and Screenlock keys.
+ * If this needs to change, please create a new version of the command.
+ */
+#define MAX_TOP_ROW_KEYS 15
+#define MIN_TOP_ROW_KEYS 10
+
+/*
+ * Is the keyboard capable of sending function keys *in addition to*
+ * action keys. This is possible for e.g. if the keyboard has a
+ * dedicated Fn key.
+ */
+#define KEYBD_CAP_FUNCTION_KEYS BIT(0)
+/*
+ * Whether the keyboard has a dedicated numeric keyboard.
+ */
+#define KEYBD_CAP_NUMERIC_KEYPAD BIT(1)
+/*
+ * Whether the keyboard has a screenlock key.
+ */
+#define KEYBD_CAP_SCRNLOCK_KEY BIT(2)
+
+struct ec_response_keybd_config {
+ /*
+ * Number of top row keys, excluding Esc and Screenlock.
+ * If this is 0, all Vivaldi keyboard code is disabled.
+ * (i.e. does not expose any tables to the kernel).
+ */
+ uint8_t num_top_row_keys;
+
+ /*
+ * The action keys in the top row, in order from left to right.
+ * The values are filled from enum action_key. Esc and Screenlock
+ * keys are not considered part of top row keys.
+ */
+ uint8_t action_keys[MAX_TOP_ROW_KEYS];
+
+ /* Capability flags */
+ uint8_t capabilities;
+
+} __ec_align1;
/*****************************************************************************/
/* The command range 0x200-0x2FF is reserved for Rotor. */