diff options
author | Jett Rink <jettrink@chromium.org> | 2018-09-04 10:19:25 -0600 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-09-10 13:33:43 -0700 |
commit | f48bb683973e10a008eaf0d327ea15d0062bfc1e (patch) | |
tree | 1ab9fa1c3c9a72864dc9bf307dc107e56ee0abd0 /board/fleex/board.c | |
parent | 68d10c79fb7ce9ff5ce58147465dab56b3e43233 (diff) | |
download | chrome-ec-f48bb683973e10a008eaf0d327ea15d0062bfc1e.tar.gz |
octopus: disable tablet mode switch for clamshells
BRANCH=none
BUG=b:113837268
TEST=verified that free magnet cannot put a clamshell SKU into tablet mode
Change-Id: I5d69ede2da04cb5d067b6ae5a483323054b584ab
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1204452
Diffstat (limited to 'board/fleex/board.c')
-rw-r--r-- | board/fleex/board.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/board/fleex/board.c b/board/fleex/board.c index 6cedd0cecc..220c031c95 100644 --- a/board/fleex/board.c +++ b/board/fleex/board.c @@ -49,6 +49,8 @@ #define USB_PD_PORT_ANX7447 0 #define USB_PD_PORT_PS8751 1 +static uint8_t sku_id; + static void ppc_interrupt(enum gpio_signal signal) { switch (signal) { @@ -130,7 +132,6 @@ static struct stprivate_data g_lis2dh_data; static struct lsm6dsm_data lsm6dsm_g_data; static struct lsm6dsm_data lsm6dsm_a_data; -static uint16_t sku_id; /* Drivers */ struct motion_sensor_t motion_sensors[] = { [LID_ACCEL] = { @@ -215,12 +216,14 @@ static int board_is_convertible(void) return sku_id == 0x21 || sku_id == 0x22 || sku_id == 0xff; } -static void board_set_motion_sensor_count(void) +static void board_update_sensor_config_from_sku(void) { - if (board_is_convertible()) + if (board_is_convertible()) { motion_sensor_count = ARRAY_SIZE(motion_sensors); - else + } else { motion_sensor_count = 0; + tablet_disable_switch(); + } } static void cbi_init(void) @@ -231,7 +234,7 @@ static void cbi_init(void) sku_id = val; ccprints("SKU: 0x%04x", sku_id); - board_set_motion_sensor_count(); + board_update_sensor_config_from_sku(); } DECLARE_HOOK(HOOK_INIT, cbi_init, HOOK_PRIO_INIT_I2C + 1); |