summaryrefslogtreecommitdiff
path: root/board/fleex
diff options
context:
space:
mode:
authorFurquan Shaikh <furquan@google.com>2018-11-20 21:57:50 -0800
committerchrome-bot <chrome-bot@chromium.org>2018-11-29 04:31:49 -0800
commit625a4d856d767c3226e6869f5d38ca3c70b2b95c (patch)
treef96db72812182d06a46872c4139fc9ab791f2992 /board/fleex
parentfd6412f0ec89fd5570279d6081ae425107b3c9ea (diff)
downloadchrome-ec-625a4d856d767c3226e6869f5d38ca3c70b2b95c.tar.gz
tablet_mode: Introduce hall sensor specific handling
This change performs the following renaming: 1. CONFIG_TABLET_SWITCH -> CONFIG_HALL_SENSOR Indicates if a device has hall sensor 2. TABLET_MODE_GPIO_L -> HALL_SENSOR_GPIO_L Provides the interrupt line from hall sensor to EC. 3. tablet_mode_isr -> hall_sensor_isr Interrupt routine that gets control on hall sensor interrupt. 4. tablet_mode_init -> hall_sensor_init Init routine for initializing hall sensor interrupt. 5. tablet_switch_disable -> hall_sensor_disable Disable hall sensor interrupt and tablet mode sub-system. This is done to separate hall sensor interrupt from tablet mode handling. It is another step towards aligning tablet mode detection on EC with Chrome. Hall sensor interrupt occurs when the lid is in 360-degree flipped mode. If tablet mode is not already triggered by lid motion driver, then hall_sensor_isr will set tablet mode and take necessary actions to disable input peripherals. CQ-DEPEND=CL:1351518 BUG=b:120050761 BRANCH=octopus TEST=make -j buildall Change-Id: I5841f6875d538a624cb888bc048f252397ab457c Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/1350469 Commit-Ready: Furquan Shaikh <furquan@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
Diffstat (limited to 'board/fleex')
-rw-r--r--board/fleex/board.c2
-rw-r--r--board/fleex/gpio.inc2
2 files changed, 2 insertions, 2 deletions
diff --git a/board/fleex/board.c b/board/fleex/board.c
index 3b6490e7d3..c1d0f16bd6 100644
--- a/board/fleex/board.c
+++ b/board/fleex/board.c
@@ -214,7 +214,7 @@ static void board_update_sensor_config_from_sku(void)
gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L);
} else {
motion_sensor_count = 0;
- tablet_disable_switch();
+ hall_sensor_disable();
/* Base accel is not stuffed, don't allow line to float */
gpio_set_flags(GPIO_BASE_SIXAXIS_INT_L,
GPIO_INPUT | GPIO_PULL_DOWN);
diff --git a/board/fleex/gpio.inc b/board/fleex/gpio.inc
index c5bbafa38d..3a15fdc2fb 100644
--- a/board/fleex/gpio.inc
+++ b/board/fleex/gpio.inc
@@ -37,7 +37,7 @@ GPIO_INT(ALL_SYS_PGOOD, PIN(F, 4), GPIO_INT_BOTH, power_signal_interrupt) /* PM
/* Other interrupts */
GPIO_INT(WP_L, PIN(A, 1), GPIO_INT_BOTH, switch_interrupt) /* EC_WP_ODL */
-GPIO_INT(TABLET_MODE_L, PIN(8, 6), GPIO_INT_BOTH, tablet_mode_isr)
+GPIO_INT(TABLET_MODE_L, PIN(8, 6), GPIO_INT_BOTH, hall_sensor_isr)
GPIO_INT(BASE_SIXAXIS_INT_L, PIN(5, 6), GPIO_INT_FALLING | GPIO_SEL_1P8V, lsm6dsm_interrupt)
GPIO(LID_ACCEL_INT_L, PIN(5, 0), GPIO_INPUT | GPIO_SEL_1P8V)