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 /board | |
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 'board')
-rw-r--r-- | board/ampton/board.c | 2 | ||||
-rw-r--r-- | board/ampton/gpio.inc | 2 | ||||
-rw-r--r-- | board/bip/gpio.inc | 2 | ||||
-rw-r--r-- | board/bobba/board.c | 2 | ||||
-rw-r--r-- | board/bobba/gpio.inc | 2 | ||||
-rw-r--r-- | board/fleex/board.c | 2 | ||||
-rw-r--r-- | board/fleex/gpio.inc | 2 | ||||
-rw-r--r-- | board/hammer/board.h | 4 | ||||
-rw-r--r-- | board/hammer/gpio.inc | 2 | ||||
-rw-r--r-- | board/meep/board.c | 2 | ||||
-rw-r--r-- | board/meep/gpio.inc | 2 | ||||
-rw-r--r-- | board/nami/board.h | 4 | ||||
-rw-r--r-- | board/nami/gpio.inc | 2 | ||||
-rw-r--r-- | board/phaser/board.c | 2 | ||||
-rw-r--r-- | board/phaser/gpio.inc | 2 | ||||
-rw-r--r-- | board/rammus/board.h | 4 | ||||
-rw-r--r-- | board/rammus/gpio.inc | 2 | ||||
-rw-r--r-- | board/yorp/gpio.inc | 2 |
18 files changed, 21 insertions, 21 deletions
diff --git a/board/ampton/board.c b/board/ampton/board.c index b2cfa271f3..7f4b7b07b3 100644 --- a/board/ampton/board.c +++ b/board/ampton/board.c @@ -218,7 +218,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, diff --git a/board/ampton/gpio.inc b/board/ampton/gpio.inc index 35dce20867..a6c293eee2 100644 --- a/board/ampton/gpio.inc +++ b/board/ampton/gpio.inc @@ -38,7 +38,7 @@ GPIO_INT(ESPI_RESET_L, PIN(D, 2), GPIO_INT_FALLING | GPIO_SEL_1P8V, espi_reset #endif /* Other interrupts */ -GPIO_INT(TABLET_MODE_L, PIN(H, 4), GPIO_INT_BOTH, tablet_mode_isr) +GPIO_INT(TABLET_MODE_L, PIN(H, 4), GPIO_INT_BOTH, hall_sensor_isr) GPIO_INT(EC_VOLDN_BTN_ODL, PIN(D, 6), GPIO_INT_BOTH, button_interrupt) GPIO_INT(EC_VOLUP_BTN_ODL, PIN(D, 5), GPIO_INT_BOTH, button_interrupt) GPIO_INT(BASE_SIXAXIS_INT_L, PIN(J, 2), GPIO_INT_FALLING | GPIO_SEL_1P8V, bmi160_interrupt) diff --git a/board/bip/gpio.inc b/board/bip/gpio.inc index 5bfba55484..80da333636 100644 --- a/board/bip/gpio.inc +++ b/board/bip/gpio.inc @@ -38,7 +38,7 @@ GPIO_INT(ESPI_RESET_L, PIN(D, 2), GPIO_INT_FALLING | GPIO_SEL_1P8V, espi_reset #endif /* Other interrupts */ -GPIO_INT(TABLET_MODE_L, PIN(H, 4), GPIO_INT_BOTH, tablet_mode_isr) +GPIO_INT(TABLET_MODE_L, PIN(H, 4), GPIO_INT_BOTH, hall_sensor_isr) GPIO(PCH_PLTRST_L, PIN(E, 3), GPIO_INPUT) /* PLT_RST_L: Platform Reset from SoC */ GPIO(SYS_RESET_L, PIN(B, 6), GPIO_ODR_HIGH) /* SYS_RST_ODL */ diff --git a/board/bobba/board.c b/board/bobba/board.c index 10ca4a526e..8bd95b5f01 100644 --- a/board/bobba/board.c +++ b/board/bobba/board.c @@ -257,7 +257,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/bobba/gpio.inc b/board/bobba/gpio.inc index ae2208e0dc..463323b2dd 100644 --- a/board/bobba/gpio.inc +++ b/board/bobba/gpio.inc @@ -33,7 +33,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(EC_VOLUP_BTN_ODL, PIN(7, 5), GPIO_INT_BOTH, button_interrupt) GPIO_INT(EC_VOLDN_BTN_ODL, PIN(4, 0), GPIO_INT_BOTH, button_interrupt) 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) diff --git a/board/hammer/board.h b/board/hammer/board.h index 7cdaf66570..7811ab7973 100644 --- a/board/hammer/board.h +++ b/board/hammer/board.h @@ -251,8 +251,8 @@ #ifdef BOARD_WHISKERS #define CONFIG_LED_DRIVER_LM3630A #define CONFIG_TABLET_MODE -#define CONFIG_TABLET_SWITCH -#define TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L +#define CONFIG_HALL_SENSOR +#define HALL_SENSOR_GPIO_L GPIO_TABLET_MODE_L #define CONFIG_KEYBOARD_TABLET_MODE_SWITCH /* Enable control of SPI over USB */ #define CONFIG_USB_SPI diff --git a/board/hammer/gpio.inc b/board/hammer/gpio.inc index 019d9399d8..34c0838612 100644 --- a/board/hammer/gpio.inc +++ b/board/hammer/gpio.inc @@ -11,7 +11,7 @@ #ifdef SECTION_IS_RW GPIO_INT(TOUCHPAD_INT, PIN(B, 8), GPIO_INT_FALLING, touchpad_interrupt) #ifdef BOARD_WHISKERS -GPIO_INT(TABLET_MODE_L, PIN(B, 11), GPIO_PULL_UP | GPIO_INT_BOTH, tablet_mode_isr) +GPIO_INT(TABLET_MODE_L, PIN(B, 11), GPIO_PULL_UP | GPIO_INT_BOTH, hall_sensor_isr) #endif /* BOARD_WHISKERS */ #endif /* SECTION_IS_RW */ diff --git a/board/meep/board.c b/board/meep/board.c index 24f1ac4d55..85831cd85e 100644 --- a/board/meep/board.c +++ b/board/meep/board.c @@ -260,7 +260,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/meep/gpio.inc b/board/meep/gpio.inc index 2d2946a5d8..c61e4e807b 100644 --- a/board/meep/gpio.inc +++ b/board/meep/gpio.inc @@ -40,7 +40,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) diff --git a/board/nami/board.h b/board/nami/board.h index bc656a3fd9..c68fd5834f 100644 --- a/board/nami/board.h +++ b/board/nami/board.h @@ -156,8 +156,8 @@ #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH -#define CONFIG_TABLET_SWITCH -#define TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L +#define CONFIG_HALL_SENSOR +#define HALL_SENSOR_GPIO_L GPIO_TABLET_MODE_L /* USB */ #define CONFIG_USB_CHARGER diff --git a/board/nami/gpio.inc b/board/nami/gpio.inc index 546e5aaf56..d4daa8e6a1 100644 --- a/board/nami/gpio.inc +++ b/board/nami/gpio.inc @@ -34,7 +34,7 @@ GPIO_INT(USB_C1_VBUS_WAKE_L, PIN(C, 5), GPIO_INT_BOTH | GPIO_PULL_UP,vbus1_evt) GPIO_INT(USB_C0_BC12_INT_L, PIN(D, 2), GPIO_INT_FALLING, usb0_evt) GPIO_INT(USB_C1_BC12_INT_L, PIN(D, 3), GPIO_INT_FALLING, usb1_evt) GPIO_INT(ACCELGYRO3_INT_L, PIN(3, 6), GPIO_INT_FALLING | GPIO_PULL_UP, bmi160_interrupt) -GPIO_INT(TABLET_MODE_L, PIN(7, 2), GPIO_INT_BOTH, tablet_mode_isr) +GPIO_INT(TABLET_MODE_L, PIN(7, 2), GPIO_INT_BOTH, hall_sensor_isr) GPIO(ENABLE_BACKLIGHT_L, PIN(6, 7), GPIO_OUT_LOW) /* LCD backlight */ GPIO(PP3300_DX_WLAN, PIN(B, 1), GPIO_OUT_LOW) /* Enable WLAN 3.3V Power */ diff --git a/board/phaser/board.c b/board/phaser/board.c index 4a525bb949..e2953fd895 100644 --- a/board/phaser/board.c +++ b/board/phaser/board.c @@ -215,7 +215,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/phaser/gpio.inc b/board/phaser/gpio.inc index 855b0baf82..db42d6c259 100644 --- a/board/phaser/gpio.inc +++ b/board/phaser/gpio.inc @@ -40,7 +40,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) diff --git a/board/rammus/board.h b/board/rammus/board.h index 3dfd3e703a..22686ba34e 100644 --- a/board/rammus/board.h +++ b/board/rammus/board.h @@ -136,8 +136,8 @@ #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH -#define CONFIG_TABLET_SWITCH -#define TABLET_MODE_GPIO_L GPIO_TABLET_MODE +#define CONFIG_HALL_SENSOR +#define HALL_SENSOR_GPIO_L GPIO_TABLET_MODE /* USB */ #define CONFIG_USB_CHARGER diff --git a/board/rammus/gpio.inc b/board/rammus/gpio.inc index b3f6e6ac97..9176414cfc 100644 --- a/board/rammus/gpio.inc +++ b/board/rammus/gpio.inc @@ -27,7 +27,7 @@ GPIO_INT(USB_C1_VBUS_DET_L, PIN(9, 7), GPIO_INT_BOTH | GPIO_PULL_UP, vbus1_ GPIO_INT(USB_C0_BC12_INT_L, PIN(D, 3), GPIO_INT_FALLING, usb0_evt) GPIO_INT(USB_C1_BC12_INT_L, PIN(3, 3), GPIO_INT_FALLING, usb1_evt) GPIO_INT(BASE_SIXAXIS_INT_L, PIN(7, 3), GPIO_INT_FALLING | GPIO_SEL_1P8V, bmi160_interrupt) -GPIO_INT(TABLET_MODE, PIN(C, 6), GPIO_INT_BOTH, tablet_mode_isr) +GPIO_INT(TABLET_MODE, PIN(C, 6), GPIO_INT_BOTH, hall_sensor_isr) GPIO(EN_PP3300_TRACKPAD, PIN(4, 5), GPIO_OUT_LOW) /* Enable TouchPad */ GPIO(PCH_RTCRST, PIN(8, 2), GPIO_OUT_LOW) /* RTCRST# to SOC */ diff --git a/board/yorp/gpio.inc b/board/yorp/gpio.inc index 1f5e230623..b944997a93 100644 --- a/board/yorp/gpio.inc +++ b/board/yorp/gpio.inc @@ -38,7 +38,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) |