summaryrefslogtreecommitdiff
path: root/board/jacuzzi
diff options
context:
space:
mode:
authorDavid Huang <david.huang@quanta.corp-partner.google.com>2021-03-04 15:05:43 +0800
committerCommit Bot <commit-bot@chromium.org>2021-03-08 08:54:27 +0000
commitfeb60a97826a539aabcfbac88c892ff27f41ac21 (patch)
tree75c65cdca10b6e71a5cd88d433519853ce976df3 /board/jacuzzi
parent12be11a121f11d5bffba93ef83ca32b36c99c5e7 (diff)
downloadchrome-ec-feb60a97826a539aabcfbac88c892ff27f41ac21.tar.gz
juniper: kenzo disable tablet mode
Disable tablet mode for kenzo. BUG=b:172034762 BRANCH=main TEST=Overlap two system and check the top system didn't trigger tablet mode. Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Change-Id: Ia94ef5ab775ed3d430d46914ba2eebb058f46d5f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2734066 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'board/jacuzzi')
-rw-r--r--board/jacuzzi/board.c20
-rw-r--r--board/jacuzzi/board.h1
2 files changed, 20 insertions, 1 deletions
diff --git a/board/jacuzzi/board.c b/board/jacuzzi/board.c
index 2cb25917dc..ad48e8cc95 100644
--- a/board/jacuzzi/board.c
+++ b/board/jacuzzi/board.c
@@ -305,6 +305,8 @@ DECLARE_HOOK(HOOK_CHIPSET_SHUTDOWN,
static void board_init(void)
{
+ int board_version;
+
/* If the reset cause is external, pulse PMIC force reset. */
if (system_get_reset_flags() == EC_RESET_FLAG_RESET_PIN) {
gpio_set_level(GPIO_PMIC_FORCE_RESET_ODL, 0);
@@ -328,6 +330,22 @@ static void board_init(void)
/* Enable BC12 interrupt */
gpio_enable_interrupt(GPIO_BC12_EC_INT_ODL);
+
+ board_version = board_get_version();
+ if (board_version == 8 || board_version == 9) {
+ /* Disable motion sense. */
+#ifndef VARIANT_KUKUI_NO_SENSORS
+ motion_sensor_count = 0;
+ gpio_disable_interrupt(GPIO_ACCEL_INT_ODL);
+ gpio_set_flags(GPIO_ACCEL_INT_ODL,
+ GPIO_INPUT | GPIO_PULL_DOWN);
+#endif /* !VARIANT_KUKUI_NO_SENSORS */
+ /* Disable tablet mode. */
+ tablet_set_mode(0);
+ gmr_tablet_switch_disable();
+ gpio_set_flags(GPIO_TABLET_MODE_L,
+ GPIO_INPUT | GPIO_PULL_UP);
+ }
}
DECLARE_HOOK(HOOK_INIT, board_init, HOOK_PRIO_DEFAULT);
@@ -436,7 +454,7 @@ struct motion_sensor_t motion_sensors[] = {
.max_frequency = BMI_GYRO_MAX_FREQ,
},
};
-const unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
+unsigned int motion_sensor_count = ARRAY_SIZE(motion_sensors);
struct motion_sensor_t icm426xx_base_accel = {
.name = "Base Accel",
diff --git a/board/jacuzzi/board.h b/board/jacuzzi/board.h
index dbb84a1aa4..0f9ef32bfc 100644
--- a/board/jacuzzi/board.h
+++ b/board/jacuzzi/board.h
@@ -52,6 +52,7 @@
/* Motion Sensors */
#ifndef VARIANT_KUKUI_NO_SENSORS
+#define CONFIG_DYNAMIC_MOTION_SENSOR_COUNT
#define CONFIG_ACCEL_KX022 /* Lid accel */
#define CONFIG_ACCELGYRO_BMI160 /* Base accel */
#define CONFIG_ACCEL_INTERRUPTS