summaryrefslogtreecommitdiff
path: root/board/phaser
diff options
context:
space:
mode:
authorJett Rink <jettrink@chromium.org>2018-09-04 10:19:25 -0600
committerchrome-bot <chrome-bot@chromium.org>2018-09-10 13:33:43 -0700
commitf48bb683973e10a008eaf0d327ea15d0062bfc1e (patch)
tree1ab9fa1c3c9a72864dc9bf307dc107e56ee0abd0 /board/phaser
parent68d10c79fb7ce9ff5ce58147465dab56b3e43233 (diff)
downloadchrome-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/phaser')
-rw-r--r--board/phaser/board.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/board/phaser/board.c b/board/phaser/board.c
index 4fc423c33b..b529f83787 100644
--- a/board/phaser/board.c
+++ b/board/phaser/board.c
@@ -32,7 +32,7 @@
#include "util.h"
#include "battery_smart.h"
-static uint16_t sku_id;
+static uint8_t sku_id;
static void ppc_interrupt(enum gpio_signal signal)
{
@@ -196,12 +196,14 @@ static int board_is_convertible(void)
return sku_id == 2 || sku_id == 3 || sku_id == 255;
}
-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)
@@ -212,7 +214,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);