summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSue Chen <sue.chen@quanta.corp-partner.google.com>2019-05-08 13:21:13 +0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2019-05-10 08:36:29 +0000
commitf79c141eaad49160b9fc516920b0158b80d441b1 (patch)
tree9dfe5b3f37246fd39cd6732bfc665b55bf8b909c
parent6315eb67cabba86edefdc376d7a29b8c53339681 (diff)
downloadchrome-ec-f79c141eaad49160b9fc516920b0158b80d441b1.tar.gz
octopus: Support keypad function on Bobba
1. Using CONFIG_KEYBOARD_KEYPAD to choose actual_key_mask w or w/o keypad. 2. Enable keypad function on Bobba. 3. Disable scan KSO13 & 14 and modify actual_key_mask for SKU w/o keypad on Bobba. BUG=b:131095327 BRANCH=octopus TEST=make buildall Change-Id: I33ea85ec3966b4bba64b2a5aa11f186b5b92c52b Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1600944 Reviewed-by: Marco Chen <marcochen@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> (cherry picked from commit 73312c0f227d0b21d5ffa788caa4579c82c78731) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1605288 Tested-by: David Huang <David.Huang@quantatw.com> Commit-Queue: Marco Chen <marcochen@chromium.org>
-rw-r--r--baseboard/octopus/baseboard.c5
-rw-r--r--board/bobba/board.c21
-rw-r--r--board/bobba/board.h3
3 files changed, 29 insertions, 0 deletions
diff --git a/baseboard/octopus/baseboard.c b/baseboard/octopus/baseboard.c
index 8aeb0a8e0b..68e52ffcf7 100644
--- a/baseboard/octopus/baseboard.c
+++ b/baseboard/octopus/baseboard.c
@@ -65,8 +65,13 @@ struct keyboard_scan_config keyscan_config = {
.min_post_scan_delay_us = 1000,
.poll_timeout_us = 100 * MSEC,
.actual_key_mask = {
+#ifndef CONFIG_KEYBOARD_KEYPAD
0x14, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xff,
0xa4, 0xff, 0xfe, 0x55, 0xfa, 0xca /* full set */
+#else
+ 0x1c, 0xfe, 0xff, 0xff, 0xff, 0xf5, 0xff,
+ 0xa4, 0xff, 0xfe, 0x55, 0xfe, 0xff, 0xff, 0xff, /* full set */
+#endif
},
};
diff --git a/board/bobba/board.c b/board/bobba/board.c
index eca68e19ca..9e53014fb5 100644
--- a/board/bobba/board.c
+++ b/board/bobba/board.c
@@ -26,6 +26,7 @@
#include "gpio.h"
#include "hooks.h"
#include "i2c.h"
+#include "keyboard_raw.h"
#include "keyboard_scan.h"
#include "lid_switch.h"
#include "motion_sense.h"
@@ -278,6 +279,25 @@ static void board_update_sensor_config_from_sku(void)
}
}
+static int board_has_keypad(void)
+{
+ return sku_id == 41 || sku_id == 42 || sku_id == 43 || sku_id == 44;
+}
+
+static void board_update_no_keypad_config_from_sku(void)
+{
+ if (!board_has_keypad()) {
+ /* Disable scanning KSO13 & 14 if keypad isn't present. */
+ keyboard_raw_set_cols(KEYBOARD_COLS_NO_KEYPAD);
+ keyscan_config.actual_key_mask[11] = 0xfa;
+ keyscan_config.actual_key_mask[12] = 0xca;
+
+ /* Search key is moved back to col=1,row=0 */
+ keyscan_config.actual_key_mask[0] = 0x14;
+ keyscan_config.actual_key_mask[1] = 0xff;
+ }
+}
+
/* Read CBI from i2c eeprom and initialize variables for board variants */
static void cbi_init(void)
{
@@ -289,6 +309,7 @@ static void cbi_init(void)
CPRINTSUSB("SKU: %d", sku_id);
board_update_sensor_config_from_sku();
+ board_update_no_keypad_config_from_sku();
}
DECLARE_HOOK(HOOK_INIT, cbi_init, HOOK_PRIO_INIT_I2C + 1);
diff --git a/board/bobba/board.h b/board/bobba/board.h
index 5bc862e23a..bd5d06a594 100644
--- a/board/bobba/board.h
+++ b/board/bobba/board.h
@@ -55,6 +55,9 @@
#define CONFIG_PWM
#define CONFIG_PWM_KBLIGHT
+/* keypad */
+#define CONFIG_KEYBOARD_KEYPAD
+
#ifndef __ASSEMBLER__
/* support factory keyboard test */