summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Chen <philipchen@google.com>2019-08-15 18:24:22 -0700
committerCommit Bot <commit-bot@chromium.org>2019-09-19 03:47:09 +0000
commit0beadf2ffd8b23e15d1e7c14de8719d0f45c9519 (patch)
tree9b531ef5087e3935542560a4bc9b7cc379c3e843
parent16d2b24ac05f7a5654bddcf9cb61f0f6684d1806 (diff)
downloadchrome-ec-0beadf2ffd8b23e15d1e7c14de8719d0f45c9519.tar.gz
tablet_mode: Renaming for GMR sensor
GMR sensors can be used to (1) detect clamshell/tablet mode (2) detect lid open/closed But hall sensors can only do (2). Therefore the naming related to "hall sensor" for tablet mode application is incorrect. This patch performs the following renaming to better reflect the reality: config: CONFIG_HALL_SENSOR -> CONFIG_GMR_TABLET_MODE CONFIG_HALL_SENSOR_CUSTOM -> CONFIG_GMR_TABLET_MODE_CUSTOM CONFIG_DPTF_MOTION_LID_NO_HALL_SENSOR -> CONFIG_DPTF_MOTION_LID_NO_GMR_SENSOR GPIO: HALL_SENSOR_GPIO_L -> GMR_TABLET_MODE_GPIO_L functions: hall_sensor_disable() -> gmr_tablet_switch_disable() hall_sensor_isr() -> gmr_tablet_switch_isr() hall_sensor_int() -> gmr_tablet_switch_init() variable: hall_sensor_at_360 -> gmr_sensor_at_360 BUG=b:139378190 BRANCH=none TEST=make buildall Change-Id: I28393d056ddd128d8ffafc16a1f9fefee5455ccc Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1757275 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
-rw-r--r--baseboard/intelrvp/baseboard.h4
-rw-r--r--baseboard/octopus/baseboard.h4
-rw-r--r--board/ampton/board.c2
-rw-r--r--board/ampton/gpio.inc2
-rw-r--r--board/arcada_ish/board.c2
-rw-r--r--board/arcada_ish/board.h6
-rw-r--r--board/arcada_ish/gpio.inc2
-rw-r--r--board/bloog/board.c2
-rw-r--r--board/bloog/gpio.inc2
-rw-r--r--board/bobba/board.c2
-rw-r--r--board/bobba/gpio.inc2
-rw-r--r--board/drallion_ish/board.h6
-rw-r--r--board/drallion_ish/gpio.inc2
-rw-r--r--board/fleex/analyzestack.yaml2
-rw-r--r--board/fleex/board.c2
-rw-r--r--board/fleex/gpio.inc2
-rw-r--r--board/garg/board.c2
-rw-r--r--board/garg/gpio.inc2
-rw-r--r--board/hammer/board.h2
-rw-r--r--board/hammer/gpio.inc6
-rw-r--r--board/helios/board.h2
-rw-r--r--board/meep/board.c2
-rw-r--r--board/meep/gpio.inc2
-rw-r--r--board/nami/board.h4
-rw-r--r--board/nami/gpio.inc2
-rw-r--r--board/nautilus/board.h2
-rw-r--r--board/phaser/board.c2
-rw-r--r--board/phaser/gpio.inc2
-rw-r--r--board/rammus/board.h4
-rw-r--r--board/rammus/gpio.inc2
-rw-r--r--board/tglrvpu_ite/gpio.inc2
-rw-r--r--board/yorp/gpio.inc2
-rw-r--r--common/motion_lid.c8
-rw-r--r--common/tablet_mode.c57
-rw-r--r--include/config.h18
-rw-r--r--include/tablet_mode.h22
36 files changed, 95 insertions, 94 deletions
diff --git a/baseboard/intelrvp/baseboard.h b/baseboard/intelrvp/baseboard.h
index 648f45412f..8e9d563466 100644
--- a/baseboard/intelrvp/baseboard.h
+++ b/baseboard/intelrvp/baseboard.h
@@ -108,8 +108,8 @@
/* Tablet mode */
#define CONFIG_TABLET_MODE
-#define CONFIG_HALL_SENSOR
-#define HALL_SENSOR_GPIO_L GPIO_TABLET_MODE_L
+#define CONFIG_GMR_TABLET_MODE
+#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L
/* Verified boot */
#define CONFIG_SHA256_UNROLLED
diff --git a/baseboard/octopus/baseboard.h b/baseboard/octopus/baseboard.h
index 1bce941569..83e708715d 100644
--- a/baseboard/octopus/baseboard.h
+++ b/baseboard/octopus/baseboard.h
@@ -260,8 +260,8 @@
/* Common Sensor Defines */
#define CONFIG_TABLET_MODE
-#define CONFIG_HALL_SENSOR
-#define HALL_SENSOR_GPIO_L GPIO_TABLET_MODE_L
+#define CONFIG_GMR_TABLET_MODE
+#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L
/*
* Slew rate on the PP1800_SENSOR load switch requires a short delay on startup.
*/
diff --git a/board/ampton/board.c b/board/ampton/board.c
index 4b5e7ed3f5..8c821eeb62 100644
--- a/board/ampton/board.c
+++ b/board/ampton/board.c
@@ -282,7 +282,7 @@ static void board_update_sensor_config_from_sku(void)
gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L);
} else {
motion_sensor_count = 0;
- hall_sensor_disable();
+ gmr_tablet_switch_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 5e388e8f3e..21ab353752 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, hall_sensor_isr)
+GPIO_INT(TABLET_MODE_L, PIN(H, 4), GPIO_INT_BOTH, gmr_tablet_switch_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/arcada_ish/board.c b/board/arcada_ish/board.c
index 631022aaae..8c96067be5 100644
--- a/board/arcada_ish/board.c
+++ b/board/arcada_ish/board.c
@@ -156,7 +156,7 @@ int board_sensor_at_360(void)
* also active.
*/
return lid_is_open() &&
- !gpio_get_level(HALL_SENSOR_GPIO_L);
+ !gpio_get_level(GMR_TABLET_MODE_GPIO_L);
}
/* Initialize board. */
diff --git a/board/arcada_ish/board.h b/board/arcada_ish/board.h
index f036bfd301..ca69c1ba15 100644
--- a/board/arcada_ish/board.h
+++ b/board/arcada_ish/board.h
@@ -54,9 +54,9 @@
#define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL
#define CONFIG_TABLET_MODE
-#define CONFIG_HALL_SENSOR
-#define CONFIG_HALL_SENSOR_CUSTOM
-#define HALL_SENSOR_GPIO_L GPIO_TABLET_MODE_L
+#define CONFIG_GMR_TABLET_MODE
+#define CONFIG_GMR_TABLET_MODE_CUSTOM
+#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L
/* DMA paging between SRAM and DRAM */
#define CONFIG_DMA_PAGING
diff --git a/board/arcada_ish/gpio.inc b/board/arcada_ish/gpio.inc
index 91c25fe632..336f807269 100644
--- a/board/arcada_ish/gpio.inc
+++ b/board/arcada_ish/gpio.inc
@@ -7,7 +7,7 @@
GPIO_INT(ACCEL_GYRO_INT_L, PIN(0), GPIO_INT_FALLING, lsm6dsm_interrupt)
GPIO_INT(LID_OPEN, PIN(5), GPIO_INT_BOTH, lid_interrupt) /* LID_CL_NB_L */
-GPIO_INT(TABLET_MODE_L, PIN(6), GPIO_INT_BOTH, hall_sensor_isr) /* LID_CL_TAB_L */
+GPIO_INT(TABLET_MODE_L, PIN(6), GPIO_INT_BOTH, gmr_tablet_switch_isr) /* LID_CL_TAB_L */
GPIO(NB_MODE_L, PIN(4), GPIO_OUT_LOW)
diff --git a/board/bloog/board.c b/board/bloog/board.c
index a092d90bf0..14f522a285 100644
--- a/board/bloog/board.c
+++ b/board/bloog/board.c
@@ -232,7 +232,7 @@ static void board_update_sensor_config_from_sku(void)
gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L);
} else {
motion_sensor_count = 0;
- hall_sensor_disable();
+ gmr_tablet_switch_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/bloog/gpio.inc b/board/bloog/gpio.inc
index fd31f4732c..631f6f03fb 100644
--- a/board/bloog/gpio.inc
+++ b/board/bloog/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, hall_sensor_isr)
+GPIO_INT(TABLET_MODE_L, PIN(8, 6), GPIO_INT_BOTH, gmr_tablet_switch_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/bobba/board.c b/board/bobba/board.c
index 8e68d0b125..9f34cbc815 100644
--- a/board/bobba/board.c
+++ b/board/bobba/board.c
@@ -262,7 +262,7 @@ static void board_update_sensor_config_from_sku(void)
gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L);
} else {
motion_sensor_count = 0;
- hall_sensor_disable();
+ gmr_tablet_switch_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 99c4967b25..699efa5cf3 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, hall_sensor_isr)
+GPIO_INT(TABLET_MODE_L, PIN(8, 6), GPIO_INT_BOTH, gmr_tablet_switch_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/drallion_ish/board.h b/board/drallion_ish/board.h
index f8e6683a20..5e94b60aee 100644
--- a/board/drallion_ish/board.h
+++ b/board/drallion_ish/board.h
@@ -53,9 +53,9 @@
#define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL
#define CONFIG_TABLET_MODE
-#define CONFIG_HALL_SENSOR
-#define CONFIG_HALL_SENSOR_CUSTOM
-#define HALL_SENSOR_GPIO_L GPIO_TABLET_MODE_L
+#define CONFIG_GMR_TABLET_MODE
+#define CONFIG_GMR_TABLET_MODE_CUSTOM
+#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L
/* DMA paging between SRAM and DRAM */
#define CONFIG_DMA_PAGING
diff --git a/board/drallion_ish/gpio.inc b/board/drallion_ish/gpio.inc
index 89b025e178..93e6752e2b 100644
--- a/board/drallion_ish/gpio.inc
+++ b/board/drallion_ish/gpio.inc
@@ -7,7 +7,7 @@
GPIO_INT(ACCEL_GYRO_INT_L, PIN(0), GPIO_INT_FALLING, lsm6dsm_interrupt)
GPIO_INT(LID_OPEN, PIN(5), GPIO_INT_BOTH, lid_interrupt) /* LID_CL_NB_L */
-GPIO_INT(TABLET_MODE_L, PIN(6), GPIO_INT_BOTH, hall_sensor_isr) /* LID_CL_TAB_L */
+GPIO_INT(TABLET_MODE_L, PIN(6), GPIO_INT_BOTH, gmr_tablet_switch_isr) /* LID_CL_TAB_L */
GPIO(NB_MODE_L, PIN(4), GPIO_OUT_LOW)
diff --git a/board/fleex/analyzestack.yaml b/board/fleex/analyzestack.yaml
index c0095c34f8..08c8ba93a9 100644
--- a/board/fleex/analyzestack.yaml
+++ b/board/fleex/analyzestack.yaml
@@ -267,7 +267,7 @@ remove:
# Remove nonesense hook paths that come from the general hook_notify above (Note: these are not a comprehensive list, but a list of
# paths that came up as longest during analysis
# These functions do not call HOOK_INIT
-- [ [ s0ix_transition, charger_task, power_button_change_deferred, jump_to_image, tablet_set_mode, pd_set_suspend, set_state, extpower_deferred, lid_switch_open, lid_switch_close, espi_chipset_reset, lpc_chipset_reset ], hook_notify, [ usb_charger_init, baseboard_tcpc_init, motion_sense_startup, hall_sensor_init, powerbtn_x86_init, cbi_init ] ]
+- [ [ s0ix_transition, charger_task, power_button_change_deferred, jump_to_image, tablet_set_mode, pd_set_suspend, set_state, extpower_deferred, lid_switch_open, lid_switch_close, espi_chipset_reset, lpc_chipset_reset ], hook_notify, [ usb_charger_init, baseboard_tcpc_init, motion_sense_startup, gmr_tablet_switch_init, powerbtn_x86_init, cbi_init ] ]
# These functions do not call HOOK_CHIPSET_SHUTDOWN
- [ [ s0ix_transition, charger_task, power_button_change_deferred, jump_to_image, tablet_set_mode, pd_set_suspend, set_state, extpower_deferred, lid_switch_open, lid_switch_close, hook_task, espi_chipset_reset, lpc_chipset_reset ], hook_notify, [ system_common_shutdown, motion_sense_shutdown, board_disable_a1_redriver ] ]
# These functions do not call HOOK_LID_CHANGE
diff --git a/board/fleex/board.c b/board/fleex/board.c
index 2e3557c6b7..57f13b5e49 100644
--- a/board/fleex/board.c
+++ b/board/fleex/board.c
@@ -220,7 +220,7 @@ static void board_update_sensor_config_from_sku(void)
gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L);
} else {
motion_sensor_count = 0;
- hall_sensor_disable();
+ gmr_tablet_switch_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 987a02674b..99870a844f 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, hall_sensor_isr)
+GPIO_INT(TABLET_MODE_L, PIN(8, 6), GPIO_INT_BOTH, gmr_tablet_switch_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/garg/board.c b/board/garg/board.c
index 9aa7db97f0..db37841560 100644
--- a/board/garg/board.c
+++ b/board/garg/board.c
@@ -225,7 +225,7 @@ static void board_update_sensor_config_from_sku(void)
gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L);
} else {
motion_sensor_count = 0;
- hall_sensor_disable();
+ gmr_tablet_switch_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/garg/gpio.inc b/board/garg/gpio.inc
index c3e96c865e..fecc1aa14f 100644
--- a/board/garg/gpio.inc
+++ b/board/garg/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, hall_sensor_isr)
+GPIO_INT(TABLET_MODE_L, PIN(8, 6), GPIO_INT_BOTH, gmr_tablet_switch_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/hammer/board.h b/board/hammer/board.h
index 88627bd15a..87893e5f06 100644
--- a/board/hammer/board.h
+++ b/board/hammer/board.h
@@ -219,7 +219,7 @@
#ifdef CONFIG_HALL_SENSOR
#define CONFIG_TABLET_MODE
-#define HALL_SENSOR_GPIO_L GPIO_TABLET_MODE_L
+#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L
#define CONFIG_KEYBOARD_TABLET_MODE_SWITCH
#endif
diff --git a/board/hammer/gpio.inc b/board/hammer/gpio.inc
index 24c683f731..207045b868 100644
--- a/board/hammer/gpio.inc
+++ b/board/hammer/gpio.inc
@@ -12,9 +12,9 @@
#ifndef HAS_NO_TOUCHPAD
GPIO_INT(TOUCHPAD_INT, PIN(B, 8), GPIO_INT_FALLING, touchpad_interrupt)
#endif /* !HAS_NO_TOUCHPAD */
-#ifdef CONFIG_HALL_SENSOR
-GPIO_INT(TABLET_MODE_L, PIN(B, 11), GPIO_PULL_UP | GPIO_INT_BOTH, hall_sensor_isr)
-#endif /* CONFIG_HALL_SENSOR */
+#ifdef CONFIG_GMR_TABLET_MODE
+GPIO_INT(TABLET_MODE_L, PIN(B, 11), GPIO_PULL_UP | GPIO_INT_BOTH, gmr_tablet_switch_isr)
+#endif /* CONFIG_GMR_TABLET_MODE */
#endif /* SECTION_IS_RW */
/* Keyboard inputs */
diff --git a/board/helios/board.h b/board/helios/board.h
index 1b502a4f6c..11c22c3812 100644
--- a/board/helios/board.h
+++ b/board/helios/board.h
@@ -74,7 +74,7 @@
#define CONFIG_STEINHART_HART_3V3_30K9_47K_4050B
/* DPTF */
-#define CONFIG_DPTF_MOTION_LID_NO_HALL_SENSOR
+#define CONFIG_DPTF_MOTION_LID_NO_GMR_SENSOR
#define CONFIG_DPTF_MULTI_PROFILE
/*
diff --git a/board/meep/board.c b/board/meep/board.c
index 48b12a2398..c62065e58b 100644
--- a/board/meep/board.c
+++ b/board/meep/board.c
@@ -232,7 +232,7 @@ static void board_update_sensor_config_from_sku(void)
gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L);
} else {
motion_sensor_count = 0;
- hall_sensor_disable();
+ gmr_tablet_switch_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 d1d29a6031..a14a21e138 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, hall_sensor_isr)
+GPIO_INT(TABLET_MODE_L, PIN(8, 6), GPIO_INT_BOTH, gmr_tablet_switch_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 1ca6a54031..b681d00dad 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_HALL_SENSOR
-#define HALL_SENSOR_GPIO_L GPIO_TABLET_MODE_L
+#define CONFIG_GMR_TABLET_MODE
+#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L
/* USB */
#define CONFIG_USB_CHARGER
diff --git a/board/nami/gpio.inc b/board/nami/gpio.inc
index d4daa8e6a1..7bc922edaa 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, hall_sensor_isr)
+GPIO_INT(TABLET_MODE_L, PIN(7, 2), GPIO_INT_BOTH, gmr_tablet_switch_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/nautilus/board.h b/board/nautilus/board.h
index 727c1b1fbb..1bab4c4c72 100644
--- a/board/nautilus/board.h
+++ b/board/nautilus/board.h
@@ -21,7 +21,7 @@
#define CONFIG_BOARD_FORCE_RESET_PIN
#define CONFIG_CASE_CLOSED_DEBUG_EXTERNAL
#define CONFIG_DPTF
-#define CONFIG_DPTF_MOTION_LID_NO_HALL_SENSOR
+#define CONFIG_DPTF_MOTION_LID_NO_GMR_SENSOR
#define CONFIG_DPTF_MULTI_PROFILE
#define CONFIG_FLASH_SIZE 0x80000
#define CONFIG_FPU
diff --git a/board/phaser/board.c b/board/phaser/board.c
index a0097f2d8f..fb0878122a 100644
--- a/board/phaser/board.c
+++ b/board/phaser/board.c
@@ -207,7 +207,7 @@ static void board_update_sensor_config_from_sku(void)
gpio_enable_interrupt(GPIO_BASE_SIXAXIS_INT_L);
} else {
motion_sensor_count = 0;
- hall_sensor_disable();
+ gmr_tablet_switch_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 b05a72ff7b..c70d0a543e 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, hall_sensor_isr)
+GPIO_INT(TABLET_MODE_L, PIN(8, 6), GPIO_INT_BOTH, gmr_tablet_switch_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 330df91140..f471fe6ce6 100644
--- a/board/rammus/board.h
+++ b/board/rammus/board.h
@@ -133,8 +133,8 @@
#define CONFIG_TABLET_MODE
#define CONFIG_TABLET_MODE_SWITCH
-#define CONFIG_HALL_SENSOR
-#define HALL_SENSOR_GPIO_L GPIO_TABLET_MODE
+#define CONFIG_GMR_TABLET_MODE
+#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE
/* USB */
#define CONFIG_USB_CHARGER
diff --git a/board/rammus/gpio.inc b/board/rammus/gpio.inc
index 1a8f076aba..b55fe6b47c 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, hall_sensor_isr)
+GPIO_INT(TABLET_MODE, PIN(C, 6), GPIO_INT_BOTH, gmr_tablet_switch_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/tglrvpu_ite/gpio.inc b/board/tglrvpu_ite/gpio.inc
index 4994154742..d469480e3e 100644
--- a/board/tglrvpu_ite/gpio.inc
+++ b/board/tglrvpu_ite/gpio.inc
@@ -40,7 +40,7 @@ GPIO_INT(WP_L, PIN(I, 4), GPIO_INT_BOTH, switch_interrupt) /* EC_WP_ODL */
GPIO_INT(ESPI_RESET_L, PIN(D, 2), GPIO_INT_FALLING | GPIO_SEL_1P8V, espi_reset_pin_asserted_interrupt) /* eSPI_reset# */
#endif
-GPIO_INT(TABLET_MODE_L, PIN(K, 1), GPIO_INT_BOTH, hall_sensor_isr)
+GPIO_INT(TABLET_MODE_L, PIN(K, 1), GPIO_INT_BOTH, gmr_tablet_switch_isr)
/* DC Jack presence coming from +VADP_OUT */
GPIO_INT(DC_JACK_PRESENT, PIN(J, 2), GPIO_INT_BOTH, board_dc_jack_interrupt)
diff --git a/board/yorp/gpio.inc b/board/yorp/gpio.inc
index 4df33ddf3a..d36a6b768d 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, hall_sensor_isr)
+GPIO_INT(TABLET_MODE_L, PIN(8, 6), GPIO_INT_BOTH, gmr_tablet_switch_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/common/motion_lid.c b/common/motion_lid.c
index 7354639083..bb07dcaf91 100644
--- a/common/motion_lid.c
+++ b/common/motion_lid.c
@@ -207,7 +207,7 @@ static int lid_angle_set_tablet_mode_threshold(int angle, int hys)
#endif /* CONFIG_TABLET_MODE */
#if defined(CONFIG_DPTF_MULTI_PROFILE) && \
- defined(CONFIG_DPTF_MOTION_LID_NO_HALL_SENSOR)
+ defined(CONFIG_DPTF_MOTION_LID_NO_GMR_SENSOR)
/*
* If CONFIG_DPTF_MULTI_PROFILE is defined by a board, then lid motion driver
@@ -264,7 +264,7 @@ static void motion_lid_set_dptf_profile(int reliable)
debounce_cnt = DPTF_MODE_DEBOUNCE_COUNT;
}
-#endif /* CONFIG_DPTF_MULTI_PROFILE && CONFIG_DPTF_MOTION_LID_NO_HALL_SENSOR */
+#endif /* CONFIG_DPTF_MULTI_PROFILE && CONFIG_DPTF_MOTION_LID_NO_GMR_SENSOR */
/**
* Calculate the lid angle using two acceleration vectors, one recorded in
@@ -458,9 +458,9 @@ end_calculate_lid_angle:
motion_lid_set_tablet_mode(reliable);
#if defined(CONFIG_DPTF_MULTI_PROFILE) && \
- defined(CONFIG_DPTF_MOTION_LID_NO_HALL_SENSOR)
+ defined(CONFIG_DPTF_MOTION_LID_NO_GMR_SENSOR)
motion_lid_set_dptf_profile(reliable);
-#endif /* CONFIG_DPTF_MULTI_PROFILE && CONFIG_DPTF_MOTION_LID_NO_HALL_SENSOR */
+#endif /* CONFIG_DPTF_MULTI_PROFILE && CONFIG_DPTF_MOTION_LID_NO_GMR_SENSOR */
#else /* CONFIG_TABLET_MODE */
end_calculate_lid_angle:
diff --git a/common/tablet_mode.c b/common/tablet_mode.c
index 5da4db7821..b74dc5fc49 100644
--- a/common/tablet_mode.c
+++ b/common/tablet_mode.c
@@ -19,8 +19,8 @@
static int tablet_mode = -1;
static int forced_tablet_mode = -1;
-/* 1: hall sensor is reporting 360 degrees. */
-static int hall_sensor_at_360;
+/* 1: GMR sensor is reporting 360 degrees. */
+static int gmr_sensor_at_360;
/*
* 1: all calls to tablet_set_mode are ignored and tablet_mode if forced to 0
@@ -45,8 +45,9 @@ void tablet_set_mode(int mode)
return;
}
- if (hall_sensor_at_360 && !mode) {
- CPRINTS("Ignoring tablet mode exit while hall sensor active.");
+ if (gmr_sensor_at_360 && !mode) {
+ CPRINTS("Ignoring tablet mode exit while gmr sensor "
+ "reports 360-degree tablet mode.");
return;
}
@@ -86,18 +87,18 @@ void tablet_disable(void)
}
/* This ifdef can be removed once we clean up past projects which do own init */
-#ifdef CONFIG_HALL_SENSOR
-#ifndef HALL_SENSOR_GPIO_L
-#error HALL_SENSOR_GPIO_L must be defined
+#ifdef CONFIG_GMR_TABLET_MODE
+#ifndef GMR_TABLET_MODE_GPIO_L
+#error GMR_TABLET_MODE_GPIO_L must be defined
#endif
-#ifdef CONFIG_DPTF_MOTION_LID_NO_HALL_SENSOR
+#ifdef CONFIG_DPTF_MOTION_LID_NO_GMR_SENSOR
#error The board has GMR sensor
#endif
-static void hall_sensor_interrupt_debounce(void)
+static void gmr_tablet_switch_interrupt_debounce(void)
{
- hall_sensor_at_360 = IS_ENABLED(CONFIG_HALL_SENSOR_CUSTOM)
+ gmr_sensor_at_360 = IS_ENABLED(CONFIG_GMR_TABLET_MODE_CUSTOM)
? board_sensor_at_360()
- : !gpio_get_level(HALL_SENSOR_GPIO_L);
+ : !gpio_get_level(GMR_TABLET_MODE_GPIO_L);
/*
* DPTF table is updated only when the board enters/exits completely
@@ -106,7 +107,7 @@ static void hall_sensor_interrupt_debounce(void)
* calculation and update DPTF table when lid angle > 300 degrees.
*/
if (IS_ENABLED(CONFIG_HOSTCMD_X86) && IS_ENABLED(CONFIG_DPTF)) {
- acpi_dptf_set_profile_num(hall_sensor_at_360 ?
+ acpi_dptf_set_profile_num(gmr_sensor_at_360 ?
DPTF_PROFILE_FLIPPED_360_MODE :
DPTF_PROFILE_CLAMSHELL);
}
@@ -123,43 +124,43 @@ static void hall_sensor_interrupt_debounce(void)
* driver to clear it when lid goes into laptop zone.
*/
- if (!IS_ENABLED(CONFIG_LID_ANGLE) || hall_sensor_at_360)
- tablet_set_mode(hall_sensor_at_360);
+ if (!IS_ENABLED(CONFIG_LID_ANGLE) || gmr_sensor_at_360)
+ tablet_set_mode(gmr_sensor_at_360);
- if (IS_ENABLED(CONFIG_LID_ANGLE_UPDATE) && hall_sensor_at_360)
+ if (IS_ENABLED(CONFIG_LID_ANGLE_UPDATE) && gmr_sensor_at_360)
lid_angle_peripheral_enable(0);
}
-DECLARE_DEFERRED(hall_sensor_interrupt_debounce);
+DECLARE_DEFERRED(gmr_tablet_switch_interrupt_debounce);
-/* Debounce time for hall sensor interrupt */
-#define HALL_SENSOR_DEBOUNCE_US (30 * MSEC)
+/* Debounce time for gmr sensor tablet mode interrupt */
+#define GMR_SENSOR_DEBOUNCE_US (30 * MSEC)
-void hall_sensor_isr(enum gpio_signal signal)
+void gmr_tablet_switch_isr(enum gpio_signal signal)
{
- hook_call_deferred(&hall_sensor_interrupt_debounce_data,
- HALL_SENSOR_DEBOUNCE_US);
+ hook_call_deferred(&gmr_tablet_switch_interrupt_debounce_data,
+ GMR_SENSOR_DEBOUNCE_US);
}
-static void hall_sensor_init(void)
+static void gmr_tablet_switch_init(void)
{
/* If this sub-system was disabled before initializing, honor that. */
if (disabled)
return;
- gpio_enable_interrupt(HALL_SENSOR_GPIO_L);
+ gpio_enable_interrupt(GMR_TABLET_MODE_GPIO_L);
/*
* Ensure tablet mode is initialized according to the hardware state
* so that the cached state reflects reality.
*/
- hall_sensor_interrupt_debounce();
+ gmr_tablet_switch_interrupt_debounce();
}
-DECLARE_HOOK(HOOK_INIT, hall_sensor_init, HOOK_PRIO_DEFAULT);
+DECLARE_HOOK(HOOK_INIT, gmr_tablet_switch_init, HOOK_PRIO_DEFAULT);
-void hall_sensor_disable(void)
+void gmr_tablet_switch_disable(void)
{
- gpio_disable_interrupt(HALL_SENSOR_GPIO_L);
+ gpio_disable_interrupt(GMR_TABLET_MODE_GPIO_L);
/* Cancel any pending debounce calls */
- hook_call_deferred(&hall_sensor_interrupt_debounce_data, -1);
+ hook_call_deferred(&gmr_tablet_switch_interrupt_debounce_data, -1);
tablet_disable();
}
#endif
diff --git a/include/config.h b/include/config.h
index 53db82d683..6483704444 100644
--- a/include/config.h
+++ b/include/config.h
@@ -3265,17 +3265,17 @@
#undef CONFIG_TABLET_MODE_SWITCH
/*
- * Config to identify what devices have hall sensor. If a board selects
- * this config, it also needs to provide HALL_SENSOR_GPIO_L and direct its
- * interrupt to hall_sensor_isr.
+ * Config to identify what devices use GMR sensor to detect tablet mode. If a
+ * board selects this config, it also needs to provide GMR_TABLET_MODE_GPIO_L
+ * and direct its interrupt to gmr_tablet_switch_isr.
*/
-#undef CONFIG_HALL_SENSOR
+#undef CONFIG_GMR_TABLET_MODE
/*
- * Board provides board_sensor_at_360 method instead of HALL_SENSOR_GPIO_L as
- * the means for determining the state of the 360 hall sensor.
+ * Board provides board_sensor_at_360 method instead of GMR_TABLET_MODE_GPIO_L
+ * as the means for determining the state of the flipped-360-degree mode.
*/
-#undef CONFIG_HALL_SENSOR_CUSTOM
+#undef CONFIG_GMR_TABLET_MODE_CUSTOM
/*
* Add a virtual switch to indicate when detachable device has
@@ -3442,10 +3442,10 @@
/*
* If defined, this indicates to the motion lid driver that the board does not
- * have any hall sensor and hence DPTF profile selection is required to be done
+ * have any GMR sensor and hence DPTF profile selection is required to be done
* based on lid angle.
*/
-#undef CONFIG_DPTF_MOTION_LID_NO_HALL_SENSOR
+#undef CONFIG_DPTF_MOTION_LID_NO_GMR_SENSOR
/*
* If defined, device supports multiple DPTF profiles depending upon device mode
diff --git a/include/tablet_mode.h b/include/tablet_mode.h
index 8ada6cdaf5..b5a2f2f562 100644
--- a/include/tablet_mode.h
+++ b/include/tablet_mode.h
@@ -26,26 +26,26 @@ void tablet_set_mode(int mode);
void tablet_disable(void);
/**
- * Interrupt service routine for hall sensor.
+ * Interrupt service routine for gmr sensor.
*
- * HALL_SENSOR_GPIO_L must be defined.
+ * GMR_TABLET_MODE_GPIO_L must be defined.
*
* @param signal: GPIO signal
*/
-void hall_sensor_isr(enum gpio_signal signal);
+void gmr_tablet_switch_isr(enum gpio_signal signal);
/**
- * 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.
+ * Disables the interrupt on GPIO connected to gmr 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 gmr sensor's tablet mode detection on clamshell.
*/
-void hall_sensor_disable(void);
+void gmr_tablet_switch_disable(void);
/**
- * This must be defined when CONFIG_HALL_SENSOR_CUSTOM is defined. This allows
- * a board to override the default behavior that determines if the 360 sensor is
- * active: !gpio_get_level(HALL_SENSOR_GPIO_L).
+ * This must be defined when CONFIG_GMR_TABLET_MODE_CUSTOM is defined. This
+ * allows a board to override the default behavior that determines if the
+ * 360 sensor is active: !gpio_get_level(GMR_TABLET_MODE_GPIO_L).
*
* Returns 1 if the 360 sensor is active; otherwise 0.
*/