diff options
author | Furquan Shaikh <furquan@google.com> | 2018-11-20 21:57:50 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-11-29 04:31:49 -0800 |
commit | 625a4d856d767c3226e6869f5d38ca3c70b2b95c (patch) | |
tree | f96db72812182d06a46872c4139fc9ab791f2992 /include/tablet_mode.h | |
parent | fd6412f0ec89fd5570279d6081ae425107b3c9ea (diff) | |
download | chrome-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 'include/tablet_mode.h')
-rw-r--r-- | include/tablet_mode.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/include/tablet_mode.h b/include/tablet_mode.h index 34616a74a3..df42356e3f 100644 --- a/include/tablet_mode.h +++ b/include/tablet_mode.h @@ -12,19 +12,21 @@ int tablet_get_mode(void); void tablet_set_mode(int mode); /** - * Interrupt service routine for tablet switch. + * Interrupt service routine for hall sensor. * - * TABLET_MODE_GPIO_L must be defined. + * HALL_SENSOR_GPIO_L must be defined. * * @param signal: GPIO signal */ -void tablet_mode_isr(enum gpio_signal signal); +void hall_sensor_isr(enum gpio_signal signal); /** - * Disables the tablet mode switch sub-system and turns off tablet mode. This is - * useful for clamshell devices. + * Disables the interrupt on GPIO connected to hall sensor. Additionally, it + * disables the tablet mode switch sub-system and turns off tablet mode. This is + * useful when the same firmware is shared between convertible and clamshell + * devices to turn off hall sensor and tablet mode detection on clamshell. */ -void tablet_disable_switch(void); +void hall_sensor_disable(void); #else |