summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Baltieri <fabiobaltieri@google.com>2023-04-05 15:12:22 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-04-06 19:31:55 +0000
commit47f85ec20ecfffdc433179acf674c7ead8f4fdcc (patch)
treef8b54622e91516310c9740d887b18bffb240ee3b
parent845d6a4ed879fa868ae69bd724d5471bb835e141 (diff)
downloadchrome-ec-47f85ec20ecfffdc433179acf674c7ead8f4fdcc.tar.gz
keyboard_scan: drop CONFIG_KEYBOARD_LANGUAGE_ID
Drop the CONFIG_KEYBOARD_LANGUAGE_ID option and code, does not seem to be used, can't find any historical reference either. BRANCH=none BUG=b:277105687, b:80168723 TEST=zmake compare-builds -a Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: If4eb37818ec4819204bcb343c37188f70457e09d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4403956 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r--common/keyboard_scan.c60
-rw-r--r--common/system.c15
-rw-r--r--include/config.h5
-rw-r--r--include/ec_cmd_api.h1
-rw-r--r--include/ec_commands.h11
-rw-r--r--include/keyboard_config.h4
-rw-r--r--include/keyboard_raw.h7
-rw-r--r--include/keyboard_scan.h10
-rw-r--r--util/config_allowed.txt1
-rw-r--r--util/ectool.cc32
10 files changed, 1 insertions, 145 deletions
diff --git a/common/keyboard_scan.c b/common/keyboard_scan.c
index d6b42d028a..e78d130289 100644
--- a/common/keyboard_scan.c
+++ b/common/keyboard_scan.c
@@ -109,9 +109,6 @@ static uint8_t debounced_state[KEYBOARD_COLS_MAX];
static uint8_t debouncing[KEYBOARD_COLS_MAX];
/* Keys simulated-pressed */
static uint8_t simulated_key[KEYBOARD_COLS_MAX];
-#ifdef CONFIG_KEYBOARD_LANGUAGE_ID
-static uint8_t keyboard_id[KEYBOARD_IDS];
-#endif
/* Times of last scans */
static uint32_t scan_time[SCAN_TIME_COUNT];
@@ -419,38 +416,6 @@ static int read_matrix(uint8_t *state, bool at_boot)
return pressed ? 1 : 0;
}
-#ifdef CONFIG_KEYBOARD_LANGUAGE_ID
-/**
- * Read the raw keyboard IDs state.
- *
- * Used in pre-init, so must not make task-switching-dependent calls; udelay()
- * is ok because it's a spin-loop.
- *
- * @param id Destination for keyboard id (must be KEYBOARD_IDS long).
- *
- */
-static void read_matrix_id(uint8_t *id)
-{
- int c;
-
- for (c = 0; c < KEYBOARD_IDS; c++) {
- /* Select the ID pin, then wait a bit for it to settle.
- * Caveat: If a keyboard maker puts ID pins right after scan
- * columns, we can't support variable column size with a single
- * image. */
- keyboard_raw_drive_column(KEYBOARD_COLS_MAX + c);
- udelay(keyscan_config.output_settle_us);
-
- /* Read the row state */
- id[c] = keyboard_raw_read_rows();
-
- CPRINTS("Keyboard ID%u: 0x%02x", c, id[c]);
- }
-
- keyboard_raw_drive_column(KEYBOARD_COLUMN_NONE);
-}
-#endif
-
#ifdef CONFIG_KEYBOARD_RUNTIME_KEYS
static uint8_t key_vol_up_row = KEYBOARD_DEFAULT_ROW_VOL_UP;
@@ -870,11 +835,6 @@ void keyboard_scan_init(void)
read_adc_boot_keys(debounced_state);
#endif
-#ifdef CONFIG_KEYBOARD_LANGUAGE_ID
- /* Check keyboard ID state */
- read_matrix_id(keyboard_id);
-#endif
-
#ifdef CONFIG_KEYBOARD_BOOT_KEYS
/* Check for keys held down at boot */
boot_key_value = check_boot_key(debounced_state);
@@ -1159,26 +1119,6 @@ DECLARE_HOST_COMMAND(EC_CMD_KEYBOARD_FACTORY_TEST, keyboard_factory_test,
EC_VER_MASK(0));
#endif
-#ifdef CONFIG_KEYBOARD_LANGUAGE_ID
-int keyboard_get_keyboard_id(void)
-{
- int c;
- uint32_t id = 0;
-
- BUILD_ASSERT(sizeof(id) >= KEYBOARD_IDS);
-
- for (c = 0; c < KEYBOARD_IDS; c++) {
- /* Check ID ghosting if more than one bit in any KSIs was set */
- if (keyboard_id[c] & (keyboard_id[c] - 1))
- /* ID ghosting is found */
- return KEYBOARD_ID_UNREADABLE;
- else
- id |= keyboard_id[c] << (c * 8);
- }
- return id;
-}
-#endif
-
/*****************************************************************************/
/* Console commands */
#ifdef CONFIG_CMD_KEYBOARD
diff --git a/common/system.c b/common/system.c
index c7b7ed39d6..f598fb36c9 100644
--- a/common/system.c
+++ b/common/system.c
@@ -1658,21 +1658,6 @@ DECLARE_HOST_COMMAND(EC_CMD_SET_SKU_ID, host_command_set_sku_id,
EC_VER_MASK(0));
#endif
-#ifdef CONFIG_KEYBOARD_LANGUAGE_ID
-static enum ec_status
-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 enum ec_status
host_command_build_info(struct host_cmd_handler_args *args)
{
diff --git a/include/config.h b/include/config.h
index 94dc075761..9b4092db6d 100644
--- a/include/config.h
+++ b/include/config.h
@@ -3125,11 +3125,6 @@
#undef CONFIG_KEYBOARD_KSO_HIGH_DRIVE
/*
- * Add support for keyboards with language ID pins
- */
-#undef CONFIG_KEYBOARD_LANGUAGE_ID
-
-/*
* Enable keypad (a palm-sized keyboard section usually placed on the far right)
*/
#undef CONFIG_KEYBOARD_KEYPAD
diff --git a/include/ec_cmd_api.h b/include/ec_cmd_api.h
index 723b639f9d..29a63b8088 100644
--- a/include/ec_cmd_api.h
+++ b/include/ec_cmd_api.h
@@ -282,7 +282,6 @@ _CROS_EC_C0_F_PF_RF(EC_CMD_GET_CMD_VERSIONS, get_cmd_versions);
_CROS_EC_C0_F_RF(EC_CMD_GET_COMMS_STATUS, get_comms_status);
_CROS_EC_C0_F_RF(EC_CMD_GET_FEATURES, get_features);
_CROS_EC_CV_F_R(EC_CMD_GET_KEYBD_CONFIG, 0, get_keybd_config, keybd_config);
-_CROS_EC_CV_F_R(EC_CMD_GET_KEYBOARD_ID, 0, get_keyboard_id, keyboard_id);
_CROS_EC_CV_F_R(EC_CMD_GET_NEXT_EVENT, 2, get_next_event_v2, get_next_event);
_CROS_EC_C0_F_RF(EC_CMD_GET_NEXT_EVENT, get_next_event);
_CROS_EC_C0_F_PF_RF(EC_CMD_GET_PD_PORT_CAPS, get_pd_port_caps);
diff --git a/include/ec_commands.h b/include/ec_commands.h
index 51f51cbe6e..71089447ce 100644
--- a/include/ec_commands.h
+++ b/include/ec_commands.h
@@ -3725,17 +3725,6 @@ struct ec_params_mkbp_simulate_key {
uint8_t pressed;
} __ec_align1;
-#define EC_CMD_GET_KEYBOARD_ID 0x0063
-
-struct ec_response_keyboard_id {
- uint32_t keyboard_id;
-} __ec_align4;
-
-enum keyboard_id {
- KEYBOARD_ID_UNSUPPORTED = 0,
- KEYBOARD_ID_UNREADABLE = 0xffffffff,
-};
-
/* Configure keyboard scanning */
#define EC_CMD_MKBP_SET_CONFIG 0x0064
#define EC_CMD_MKBP_GET_CONFIG 0x0065
diff --git a/include/keyboard_config.h b/include/keyboard_config.h
index afb69bf141..997fe88a2b 100644
--- a/include/keyboard_config.h
+++ b/include/keyboard_config.h
@@ -14,10 +14,6 @@
/* include the board layer keyboard header file */
#include "keyboard_customization.h"
#else /* CONFIG_KEYBOARD_CUSTOMIZATION */
-#ifdef CONFIG_KEYBOARD_LANGUAGE_ID
-/* Keyboard matrix support for language ID pins */
-#define KEYBOARD_IDS 2
-#endif
/* Keyboard matrix is 13 (or 15 with keypad) output columns x 8 input rows */
#define KEYBOARD_COLS_WITH_KEYPAD 15
diff --git a/include/keyboard_raw.h b/include/keyboard_raw.h
index 350791998f..8ce26c5d39 100644
--- a/include/keyboard_raw.h
+++ b/include/keyboard_raw.h
@@ -108,15 +108,10 @@ static inline int keyboard_raw_get_cols(void)
static inline void keyboard_raw_set_cols(int cols)
{
-#ifdef CONFIG_KEYBOARD_LANGUAGE_ID
- /* Keyboard ID is probably encoded right after the last column. Scanner
- * would read keyboard ID if the column size is decreased. */
- assert(cols == KEYBOARD_COLS_MAX);
-#else
/* We can only decrease the column size. You have to assume a larger
* grid (and reduce scanning size if the keyboard has no keypad). */
assert(cols <= KEYBOARD_COLS_MAX);
-#endif
+
keyboard_cols = cols;
}
diff --git a/include/keyboard_scan.h b/include/keyboard_scan.h
index 776b7316b6..4138f11ca5 100644
--- a/include/keyboard_scan.h
+++ b/include/keyboard_scan.h
@@ -122,16 +122,6 @@ static inline void keyboard_scan_enable(int enable,
}
#endif
-#ifdef CONFIG_KEYBOARD_LANGUAGE_ID
-/**
- * Get the KEYBOARD ID for a keyboard
- *
- * @return A value that identifies keyboard variants. Its meaning and
- * the number of bits actually used is the supported keyboard layout.
- */
-int keyboard_get_keyboard_id(void);
-#endif
-
#ifdef CONFIG_KEYBOARD_RUNTIME_KEYS
void set_vol_up_key(uint8_t row, uint8_t col);
#else
diff --git a/util/config_allowed.txt b/util/config_allowed.txt
index 4b6a878c36..264eada2fa 100644
--- a/util/config_allowed.txt
+++ b/util/config_allowed.txt
@@ -549,7 +549,6 @@ CONFIG_KEYBOARD_BOOT_KEYS
CONFIG_KEYBOARD_IRQ_GPIO
CONFIG_KEYBOARD_KSO_BASE
CONFIG_KEYBOARD_KSO_HIGH_DRIVE
-CONFIG_KEYBOARD_LANGUAGE_ID
CONFIG_KEYBOARD_MULTIPLE
CONFIG_KEYBOARD_POST_SCAN_CLOCKS
CONFIG_KEYBOARD_PRINT_SCAN_TIMES
diff --git a/util/ectool.cc b/util/ectool.cc
index 1f67d271cc..055ac9e4ba 100644
--- a/util/ectool.cc
+++ b/util/ectool.cc
@@ -9131,37 +9131,6 @@ static int cmd_kbinfo(int argc, char *argv[])
return 0;
}
-static int cmd_kbid(int argc, char *argv[])
-{
- struct ec_response_keyboard_id response;
- int rv;
-
- if (argc > 1) {
- fprintf(stderr, "Too many args\n");
- return -1;
- }
-
- rv = ec_command(EC_CMD_GET_KEYBOARD_ID, 0, NULL, 0, &response,
- sizeof(response));
- if (rv < 0)
- return rv;
- switch (response.keyboard_id) {
- case KEYBOARD_ID_UNSUPPORTED:
- /* Keyboard ID was not supported */
- printf("Keyboard doesn't support ID\n");
- break;
- case KEYBOARD_ID_UNREADABLE:
- /* Ghosting ID was detected */
- printf("Reboot and keep hands off the keyboard during"
- " next boot-up\n");
- break;
- default:
- /* Valid keyboard ID value was reported*/
- printf("%x\n", response.keyboard_id);
- }
- return rv;
-}
-
static int cmd_keyconfig(int argc, char *argv[])
{
struct ec_params_mkbp_set_config req;
@@ -11497,7 +11466,6 @@ const struct command commands[] = {
{ "led", cmd_led },
{ "lightbar", cmd_lightbar },
{ "kbfactorytest", cmd_keyboard_factory_test },
- { "kbid", cmd_kbid },
{ "kbinfo", cmd_kbinfo },
{ "kbpress", cmd_kbpress },
{ "keyconfig", cmd_keyconfig },