diff options
author | Andrew McRae <amcrae@google.com> | 2022-01-18 13:30:10 +1100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-01-20 23:53:39 +0000 |
commit | f4b2abb9423d22e4b9bb1a28c5fa2c7aac7be6da (patch) | |
tree | 2a547deeafbfe97230b3e81d55f14d1a9c70193c | |
parent | 1b69854af42066ccbe4e584734d288cd9b5e921f (diff) | |
download | chrome-ec-f4b2abb9423d22e4b9bb1a28c5fa2c7aac7be6da.tar.gz |
ec: Rename GMR_TABLET_MODE_GPIO_L to GPIO_TABLET_MODE_L
Normalise the name of the tablet mode detection
GPIO so that everyboard does not need to redefine it.
BUG=none
TEST=zmake testall; make buildall
BRANCH=none
Signed-off-by: Andrew McRae <amcrae@google.com>
Change-Id: Ifb458e755d1e00c0cff66a02c78dfccaba2d070c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3397141
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
70 files changed, 26 insertions, 92 deletions
diff --git a/baseboard/dedede/baseboard.h b/baseboard/dedede/baseboard.h index c14f22b6d0..4fe046fc0e 100644 --- a/baseboard/dedede/baseboard.h +++ b/baseboard/dedede/baseboard.h @@ -94,7 +94,7 @@ #define GPIO_VOLUME_UP_L GPIO_VOLUP_BTN_ODL #define GPIO_VOLUME_DOWN_L GPIO_VOLDN_BTN_ODL #define GPIO_WP GPIO_EC_WP_OD -#define GMR_TABLET_MODE_GPIO_L GPIO_LID_360_L +#define GPIO_TABLET_MODE_L GPIO_LID_360_L /* Common EC defines */ diff --git a/baseboard/guybrush/baseboard.h b/baseboard/guybrush/baseboard.h index 9f010c2bf3..bf5b38b145 100644 --- a/baseboard/guybrush/baseboard.h +++ b/baseboard/guybrush/baseboard.h @@ -115,7 +115,7 @@ #define CONFIG_TABLET_MODE #define CONFIG_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE +#define GPIO_TABLET_MODE_L GPIO_TABLET_MODE #define CONFIG_DYNAMIC_MOTION_SENSOR_COUNT #define CONFIG_LID_ANGLE #define CONFIG_LID_ANGLE_UPDATE diff --git a/baseboard/kukui/baseboard.h b/baseboard/kukui/baseboard.h index fb6c9a977f..b0a70f2961 100644 --- a/baseboard/kukui/baseboard.h +++ b/baseboard/kukui/baseboard.h @@ -110,7 +110,6 @@ #define CONFIG_KEYBOARD_COL2_INVERTED #define CONFIG_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH diff --git a/baseboard/octopus/baseboard.h b/baseboard/octopus/baseboard.h index cb75bd0c1e..281adf7f1e 100644 --- a/baseboard/octopus/baseboard.h +++ b/baseboard/octopus/baseboard.h @@ -278,7 +278,6 @@ /* Common Sensor Defines */ #define CONFIG_TABLET_MODE #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/adlrvpp_ite/board.h b/board/adlrvpp_ite/board.h index 648b3402e3..55b56854ea 100644 --- a/board/adlrvpp_ite/board.h +++ b/board/adlrvpp_ite/board.h @@ -47,7 +47,7 @@ #define GPIO_PG_EC_ALL_SYS_PWRGD GPIO_ALL_SYS_PWRGD_EC #define GPIO_PCH_DSW_PWROK GPIO_DSW_PWROK_EC #define GPIO_EN_PP3300_A GPIO_EC_DS3 -#define GMR_TABLET_MODE_GPIO_L GPIO_SLATE_MODE_INDICATION +#define GPIO_TABLET_MODE_L GPIO_SLATE_MODE_INDICATION /* I2C ports & Configs */ #define CONFIG_IT83XX_SMCLK2_ON_GPC7 diff --git a/board/adlrvpp_mchp1521/board.h b/board/adlrvpp_mchp1521/board.h index b987dd775b..a76fbd87df 100644 --- a/board/adlrvpp_mchp1521/board.h +++ b/board/adlrvpp_mchp1521/board.h @@ -45,7 +45,7 @@ #define GPIO_POWER_BUTTON_L GPIO_PWRBTN_EC_IN_N /* Sensors */ -#define GMR_TABLET_MODE_GPIO_L GPIO_EC_SLATEMODE_HALLOUT_SNSR_R +#define GPIO_TABLET_MODE_L GPIO_EC_SLATEMODE_HALLOUT_SNSR_R #define GPIO_CPU_PROCHOT GPIO_PROCHOT_EC_R /* AC & Battery */ diff --git a/board/adlrvpp_mchp1521/gpio.inc b/board/adlrvpp_mchp1521/gpio.inc index 5ec398903e..ce6d2de65f 100644 --- a/board/adlrvpp_mchp1521/gpio.inc +++ b/board/adlrvpp_mchp1521/gpio.inc @@ -76,7 +76,7 @@ GPIO_INT(KBC_SCANOUT_15, PIN(0151), GPIO_INT_BOTH, ppc_interrupt) GPIO_INT(KBC_CAPSLOCK, PIN(0127), GPIO_INT_BOTH, ppc_interrupt) /* Sensor Interrupts */ -/* GMR_TABLET_MODE_GPIO_L */ +/* GPIO_TABLET_MODE_L */ GPIO_INT(EC_SLATEMODE_HALLOUT_SNSR_R, PIN(064), GPIO_INT_BOTH | GPIO_SEL_1P8V, gmr_tablet_switch_isr) diff --git a/board/adlrvpp_mchp1727/board.h b/board/adlrvpp_mchp1727/board.h index f3854090cd..d806c92314 100644 --- a/board/adlrvpp_mchp1727/board.h +++ b/board/adlrvpp_mchp1727/board.h @@ -88,7 +88,7 @@ #define GPIO_PCH_DSW_PWROK GPIO_EC_DSW_PWROK /* Sensors */ -#define GMR_TABLET_MODE_GPIO_L GPIO_SLATE_MODE_INDICATION +#define GPIO_TABLET_MODE_L GPIO_SLATE_MODE_INDICATION #define GPIO_CPU_PROCHOT GPIO_PROCHOT_EC_N /* Buttons */ diff --git a/board/adlrvpp_npcx/board.h b/board/adlrvpp_npcx/board.h index fb6134da11..c787beea84 100644 --- a/board/adlrvpp_npcx/board.h +++ b/board/adlrvpp_npcx/board.h @@ -34,7 +34,7 @@ #define GPIO_PCH_DSW_PWROK GPIO_EC_DSW_PWROK /* Sensors */ -#define GMR_TABLET_MODE_GPIO_L GPIO_SLATE_MODE_INDICATION +#define GPIO_TABLET_MODE_L GPIO_SLATE_MODE_INDICATION #define GPIO_CPU_PROCHOT GPIO_PROCHOT_EC_N /* Buttons */ diff --git a/board/arcada_ish/board.c b/board/arcada_ish/board.c index d4a8dbddbf..b23784cd38 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(GMR_TABLET_MODE_GPIO_L); + !gpio_get_level(GPIO_TABLET_MODE_L); } /* Initialize board. */ diff --git a/board/arcada_ish/board.h b/board/arcada_ish/board.h index 0064086619..b48f8fe788 100644 --- a/board/arcada_ish/board.h +++ b/board/arcada_ish/board.h @@ -56,7 +56,6 @@ #define CONFIG_TABLET_MODE #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/asurada/board.h b/board/asurada/board.h index d8ee03c9f4..f4de0af739 100644 --- a/board/asurada/board.h +++ b/board/asurada/board.h @@ -55,7 +55,6 @@ #define CONFIG_GMR_TABLET_MODE #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L #define CONFIG_ACCELGYRO_BMI160 /* Base accel */ #define CONFIG_ACCELGYRO_BMI160_INT_EVENT \ diff --git a/board/boldar/board.h b/board/boldar/board.h index 529761cfac..12409a5435 100644 --- a/board/boldar/board.h +++ b/board/boldar/board.h @@ -141,7 +141,6 @@ #define GPIO_USB_C1_BC12_INT_ODL GPIO_USB_C1_MIX_INT_ODL #define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL #define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* I2C Bus Configuration */ #define CONFIG_I2C diff --git a/board/brya/board.h b/board/brya/board.h index a599476530..42f5e4bc80 100644 --- a/board/brya/board.h +++ b/board/brya/board.h @@ -133,7 +133,6 @@ #define GPIO_PCH_SLP_S0_L GPIO_SYS_SLP_S0IX_L #define GPIO_PCH_SLP_S3_L GPIO_SLP_S3_L #define GPIO_TEMP_SENSOR_POWER GPIO_SEQ_EC_DSW_PWROK -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* * GPIO_EC_PCH_INT_ODL is used for MKBP events as well as a PCH wakeup diff --git a/board/cherry/board.h b/board/cherry/board.h index 6fb155ed00..a25239697d 100644 --- a/board/cherry/board.h +++ b/board/cherry/board.h @@ -47,7 +47,6 @@ #define CONFIG_GMR_TABLET_MODE #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* ICM426XX Base accel/gyro */ #define CONFIG_ACCELGYRO_ICM42607 diff --git a/board/coachz/board.h b/board/coachz/board.h index d5e69aa4b2..1cb062e3c5 100644 --- a/board/coachz/board.h +++ b/board/coachz/board.h @@ -73,7 +73,7 @@ #define GPIO_AC_PRESENT GPIO_CHG_ACOK_OD #define GPIO_WP_L GPIO_EC_FLASH_WP_ODL #define GPIO_PMIC_RESIN_L GPIO_PM845_RESIN_L -#define GMR_TABLET_MODE_GPIO_L GPIO_LID_360_L +#define GPIO_TABLET_MODE_L GPIO_LID_360_L #define GPIO_KS_ATTACHED_L GPIO_LID_INT_N_HALL1 #define GPIO_KS_OPEN GPIO_LID_INT_N_HALL2 diff --git a/board/collis/board.h b/board/collis/board.h index f1cf5fd3a2..22f7af1b6c 100644 --- a/board/collis/board.h +++ b/board/collis/board.h @@ -130,7 +130,6 @@ #define GPIO_USB_C1_BC12_INT_ODL GPIO_USB_C1_MIX_INT_ODL #define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL #define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* I2C Bus Configuration */ #define CONFIG_I2C diff --git a/board/copano/board.h b/board/copano/board.h index 2938c8b279..315d7bc8bb 100644 --- a/board/copano/board.h +++ b/board/copano/board.h @@ -135,7 +135,6 @@ #define GPIO_USB_C1_BC12_INT_ODL GPIO_USB_C1_MIX_INT_ODL #define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL #define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* I2C Bus Configuration */ #define CONFIG_I2C diff --git a/board/delbin/board.h b/board/delbin/board.h index 5ef7d6e9b5..c889d65b47 100644 --- a/board/delbin/board.h +++ b/board/delbin/board.h @@ -129,7 +129,6 @@ #define GPIO_USB_C1_BC12_INT_ODL GPIO_USB_C1_MIX_INT_ODL #define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL #define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* I2C Bus Configuration */ #define CONFIG_I2C diff --git a/board/dojo/board.h b/board/dojo/board.h index 8dfb377695..5436956925 100644 --- a/board/dojo/board.h +++ b/board/dojo/board.h @@ -47,7 +47,6 @@ #define CONFIG_GMR_TABLET_MODE #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* ICM426XX Base accel/gyro */ #define CONFIG_ACCELGYRO_ICM42607 diff --git a/board/drallion_ish/board.h b/board/drallion_ish/board.h index 53da677775..0d51e334a8 100644 --- a/board/drallion_ish/board.h +++ b/board/drallion_ish/board.h @@ -54,7 +54,6 @@ #define CONFIG_TABLET_MODE #define CONFIG_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* DMA paging between SRAM and DRAM */ #define CONFIG_DMA_PAGING diff --git a/board/dratini/board.h b/board/dratini/board.h index c23cbd1f2d..7424dbb5ad 100644 --- a/board/dratini/board.h +++ b/board/dratini/board.h @@ -51,7 +51,6 @@ #define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL #define CONFIG_LID_ANGLE_UPDATE #define CONFIG_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* USB Type C and USB PD defines */ #define CONFIG_USB_PD_COMM_LOCKED diff --git a/board/eldrid/board.h b/board/eldrid/board.h index 3762aab70c..df785a5573 100644 --- a/board/eldrid/board.h +++ b/board/eldrid/board.h @@ -126,7 +126,6 @@ #define GPIO_USB_C1_BC12_INT_ODL GPIO_USB_C1_MIX_INT_ODL #define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL #define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* I2C Bus Configuration */ #define CONFIG_I2C diff --git a/board/felwinter/board.h b/board/felwinter/board.h index 064ce51e54..07ee94ae01 100644 --- a/board/felwinter/board.h +++ b/board/felwinter/board.h @@ -110,7 +110,6 @@ #define GPIO_PCH_SLP_S0_L GPIO_SYS_SLP_S0IX_L #define GPIO_PCH_SLP_S3_L GPIO_SLP_S3_L #define GPIO_TEMP_SENSOR_POWER GPIO_SEQ_EC_DSW_PWROK -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* * GPIO_EC_PCH_INT_ODL is used for MKBP events as well as a PCH wakeup diff --git a/board/gimble/board.h b/board/gimble/board.h index 561dfddab1..12f5e7c693 100644 --- a/board/gimble/board.h +++ b/board/gimble/board.h @@ -110,7 +110,6 @@ #define GPIO_PCH_SLP_S0_L GPIO_SYS_SLP_S0IX_L #define GPIO_PCH_SLP_S3_L GPIO_SLP_S3_L #define GPIO_TEMP_SENSOR_POWER GPIO_SEQ_EC_DSW_PWROK -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* * GPIO_EC_PCH_INT_ODL is used for MKBP events as well as a PCH wakeup diff --git a/board/goroh/board.h b/board/goroh/board.h index dec936adb7..c5b1758aa4 100644 --- a/board/goroh/board.h +++ b/board/goroh/board.h @@ -52,7 +52,6 @@ #define CONFIG_GMR_TABLET_MODE #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L #define CONFIG_ACCELGYRO_BMI160 /* Base accel */ #define CONFIG_ACCELGYRO_BMI160_INT_EVENT \ diff --git a/board/gumboz/board.h b/board/gumboz/board.h index 0cf51b5166..b64266ab30 100644 --- a/board/gumboz/board.h +++ b/board/gumboz/board.h @@ -44,7 +44,6 @@ #define CONFIG_CMD_ACCEL_INFO #define CONFIG_TABLET_MODE #define CONFIG_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L #define CONFIG_LID_ANGLE #define CONFIG_LID_ANGLE_UPDATE #define CONFIG_LID_ANGLE_SENSOR_BASE BASE_ACCEL diff --git a/board/hammer/board.h b/board/hammer/board.h index dd5d8d1507..ceadb68176 100644 --- a/board/hammer/board.h +++ b/board/hammer/board.h @@ -229,7 +229,6 @@ #ifdef CONFIG_GMR_TABLET_MODE #define CONFIG_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L #define CONFIG_KEYBOARD_TABLET_MODE_SWITCH #endif diff --git a/board/helios/board.h b/board/helios/board.h index fa65957ecc..a898ff2d17 100644 --- a/board/helios/board.h +++ b/board/helios/board.h @@ -42,7 +42,6 @@ #define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL #define CONFIG_LID_ANGLE_UPDATE #define CONFIG_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* USB Type C and USB PD defines */ #define CONFIG_USB_PD_COMM_LOCKED diff --git a/board/herobrine_npcx9/board.h b/board/herobrine_npcx9/board.h index e0ca39fac0..790d753bbc 100644 --- a/board/herobrine_npcx9/board.h +++ b/board/herobrine_npcx9/board.h @@ -61,7 +61,6 @@ #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH #define CONFIG_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* GPIO alias */ #define GPIO_AC_PRESENT GPIO_ACOK_OD diff --git a/board/icarus/board.h b/board/icarus/board.h index b9232d65a5..0fe63af10c 100644 --- a/board/icarus/board.h +++ b/board/icarus/board.h @@ -64,7 +64,7 @@ #define CONFIG_LED_ONOFF_STATES #undef CONFIG_GMR_TABLET_MODE -#undef GMR_TABLET_MODE_GPIO_L +#undef GPIO_TABLET_MODE_L #undef CONFIG_TABLET_MODE #undef CONFIG_TABLET_MODE_SWITCH diff --git a/board/jacuzzi/board.c b/board/jacuzzi/board.c index 4563bc2f2c..a1a6d77575 100644 --- a/board/jacuzzi/board.c +++ b/board/jacuzzi/board.c @@ -573,7 +573,7 @@ int board_sensor_at_360(void) if (board_version == 8 || board_version == 9) return 0; else - return !gpio_get_level(GMR_TABLET_MODE_GPIO_L); + return !gpio_get_level(GPIO_TABLET_MODE_L); } #endif /* !VARIANT_KUKUI_NO_SENSORS */ diff --git a/board/jinlon/board.h b/board/jinlon/board.h index c071bfc144..7f433a63be 100644 --- a/board/jinlon/board.h +++ b/board/jinlon/board.h @@ -52,7 +52,6 @@ #define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL #define CONFIG_LID_ANGLE_UPDATE #define CONFIG_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* USB Type C and USB PD defines */ #define CONFIG_USB_PD_COMM_LOCKED diff --git a/board/kano/board.h b/board/kano/board.h index 4ed3d3f885..aec04b3e27 100644 --- a/board/kano/board.h +++ b/board/kano/board.h @@ -108,7 +108,6 @@ #define GPIO_PCH_SLP_S0_L GPIO_SYS_SLP_S0IX_L #define GPIO_PCH_SLP_S3_L GPIO_SLP_S3_L #define GPIO_TEMP_SENSOR_POWER GPIO_SEQ_EC_DSW_PWROK -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* * GPIO_EC_PCH_INT_ODL is used for MKBP events as well as a PCH wakeup diff --git a/board/kingoftown/board.h b/board/kingoftown/board.h index 0330bd6708..6a85d24956 100644 --- a/board/kingoftown/board.h +++ b/board/kingoftown/board.h @@ -58,7 +58,6 @@ #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH #define CONFIG_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* GPIO alias */ #define GPIO_AC_PRESENT GPIO_ACOK_OD diff --git a/board/lazor/board.h b/board/lazor/board.h index d045c13cb5..a4851948d9 100644 --- a/board/lazor/board.h +++ b/board/lazor/board.h @@ -71,7 +71,6 @@ #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH #define CONFIG_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* GPIO alias */ #define GPIO_AC_PRESENT GPIO_ACOK_OD diff --git a/board/lindar/board.h b/board/lindar/board.h index 752ae296b0..bc49b8514d 100644 --- a/board/lindar/board.h +++ b/board/lindar/board.h @@ -113,7 +113,6 @@ #define GPIO_USB_C1_BC12_INT_ODL GPIO_USB_C1_MIX_INT_ODL #define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL #define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_MUTE_BTN_ODL -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* I2C Bus Configuration */ #define CONFIG_I2C diff --git a/board/marzipan/board.h b/board/marzipan/board.h index 3ef8952ee5..1b3bba7daf 100644 --- a/board/marzipan/board.h +++ b/board/marzipan/board.h @@ -61,7 +61,6 @@ #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH #define CONFIG_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* GPIO alias */ #define GPIO_AC_PRESENT GPIO_ACOK_OD diff --git a/board/morphius/board.c b/board/morphius/board.c index d9717bbe05..beca0d89f0 100644 --- a/board/morphius/board.c +++ b/board/morphius/board.c @@ -874,7 +874,7 @@ int board_sensor_at_360(void) * mode. */ if (board_ver >= 3) - return !gpio_get_level(GMR_TABLET_MODE_GPIO_L); + return !gpio_get_level(GPIO_TABLET_MODE_L); return 0; } diff --git a/board/morphius/board.h b/board/morphius/board.h index 343f1055e5..15a15a76a0 100644 --- a/board/morphius/board.h +++ b/board/morphius/board.h @@ -49,7 +49,7 @@ #define CONFIG_LID_ANGLE_SENSOR_LID LID_ACCEL #define CONFIG_GMR_TABLET_MODE #define CONFIG_GMR_TABLET_MODE_CUSTOM -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE +#define GPIO_TABLET_MODE_L GPIO_TABLET_MODE #define RPM_DEVIATION 1 /* GPIO mapping from board specific name to EC common name. */ diff --git a/board/munna/board.h b/board/munna/board.h index 96a76b11b5..ce7a7ff54d 100644 --- a/board/munna/board.h +++ b/board/munna/board.h @@ -124,7 +124,7 @@ EC_HOST_EVENT_MASK(EC_HOST_EVENT_POWER_BUTTON)) #undef CONFIG_GMR_TABLET_MODE -#undef GMR_TABLET_MODE_GPIO_L +#undef GPIO_TABLET_MODE_L #undef CONFIG_TABLET_MODE #undef CONFIG_TABLET_MODE_SWITCH diff --git a/board/nami/board.h b/board/nami/board.h index 5952b1a754..bacb77154b 100644 --- a/board/nami/board.h +++ b/board/nami/board.h @@ -153,7 +153,6 @@ #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH #define CONFIG_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* USB */ #define CONFIG_USB_CHARGER diff --git a/board/pazquel/board.h b/board/pazquel/board.h index fa1ab621f8..04016edb4a 100644 --- a/board/pazquel/board.h +++ b/board/pazquel/board.h @@ -66,7 +66,6 @@ #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH #define CONFIG_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* GPIO alias */ #define GPIO_AC_PRESENT GPIO_ACOK_OD diff --git a/board/pico/board.c b/board/pico/board.c index eaecf77f31..8482a5c635 100644 --- a/board/pico/board.c +++ b/board/pico/board.c @@ -160,7 +160,7 @@ static bool board_is_convertible(void) int board_sensor_at_360(void) { if (board_is_convertible()) - return !gpio_get_level(GMR_TABLET_MODE_GPIO_L); + return !gpio_get_level(GPIO_TABLET_MODE_L); return 0; } diff --git a/board/pompom/board.h b/board/pompom/board.h index 3f35d7ceab..9d418480c4 100644 --- a/board/pompom/board.h +++ b/board/pompom/board.h @@ -56,7 +56,7 @@ #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH #define CONFIG_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_LID_360_L +#define GPIO_TABLET_MODE_L GPIO_LID_360_L /* GPIO alias */ #define GPIO_AC_PRESENT GPIO_ACOK_OD diff --git a/board/rammus/board.h b/board/rammus/board.h index 24df8218ca..0ee3663c2f 100644 --- a/board/rammus/board.h +++ b/board/rammus/board.h @@ -139,7 +139,7 @@ #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH #define CONFIG_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE +#define GPIO_TABLET_MODE_L GPIO_TABLET_MODE /* USB */ #define CONFIG_USB_CHARGER diff --git a/board/redrix/board.h b/board/redrix/board.h index d1f0f34f72..ca45cded8b 100644 --- a/board/redrix/board.h +++ b/board/redrix/board.h @@ -111,7 +111,6 @@ #define GPIO_PCH_SLP_S0_L GPIO_SYS_SLP_S0IX_L #define GPIO_PCH_SLP_S3_L GPIO_SLP_S3_L #define GPIO_TEMP_SENSOR_POWER GPIO_SEQ_EC_DSW_PWROK -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* * GPIO_EC_PCH_INT_ODL is used for MKBP events as well as a PCH wakeup diff --git a/board/taeko/board.h b/board/taeko/board.h index 5ba767bdb9..33124943ac 100644 --- a/board/taeko/board.h +++ b/board/taeko/board.h @@ -133,7 +133,6 @@ #define GPIO_PCH_SLP_S0_L GPIO_SYS_SLP_S0IX_L #define GPIO_PCH_SLP_S3_L GPIO_SLP_S3_L #define GPIO_TEMP_SENSOR_POWER GPIO_SEQ_EC_DSW_PWROK -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* * GPIO_EC_PCH_INT_ODL is used for MKBP events as well as a PCH wakeup diff --git a/board/taniks/board.h b/board/taniks/board.h index 9e55e0194f..63adaad8bd 100644 --- a/board/taniks/board.h +++ b/board/taniks/board.h @@ -130,7 +130,6 @@ #define GPIO_PCH_RTCRST GPIO_EC_PCH_RTCRST #define GPIO_PCH_SLP_S0_L GPIO_SYS_SLP_S0IX_L #define GPIO_PCH_SLP_S3_L GPIO_SLP_S3_L -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* * GPIO_EC_PCH_INT_ODL is used for MKBP events as well as a PCH wakeup diff --git a/board/terrador/board.h b/board/terrador/board.h index 94466e7bd1..4572a544c8 100644 --- a/board/terrador/board.h +++ b/board/terrador/board.h @@ -129,7 +129,6 @@ #define GPIO_USB_C1_BC12_INT_ODL GPIO_USB_C1_MIX_INT_ODL #define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL #define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* I2C Bus Configuration */ #define CONFIG_I2C diff --git a/board/trogdor/board.h b/board/trogdor/board.h index 346b135ea4..81bed03f46 100644 --- a/board/trogdor/board.h +++ b/board/trogdor/board.h @@ -63,7 +63,6 @@ #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH #define CONFIG_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* GPIO alias */ #define GPIO_AC_PRESENT GPIO_ACOK_OD diff --git a/board/voema/board.h b/board/voema/board.h index 2f1326ee7a..b5f8dc4ec8 100644 --- a/board/voema/board.h +++ b/board/voema/board.h @@ -132,7 +132,6 @@ #define GPIO_USB_C1_BC12_INT_ODL GPIO_USB_C1_MIX_INT_ODL #define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL #define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* I2C Bus Configuration */ #define CONFIG_I2C diff --git a/board/volet/board.h b/board/volet/board.h index 99c18975e4..4e957c449c 100644 --- a/board/volet/board.h +++ b/board/volet/board.h @@ -138,7 +138,6 @@ #define GPIO_USB_C1_BC12_INT_ODL GPIO_USB_C1_MIX_INT_ODL #define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL #define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* I2C Bus Configuration */ #define CONFIG_I2C diff --git a/board/volmar/board.h b/board/volmar/board.h index 2915f21d08..6193e5da68 100644 --- a/board/volmar/board.h +++ b/board/volmar/board.h @@ -121,7 +121,6 @@ #define GPIO_PCH_RTCRST GPIO_EC_PCH_RTCRST #define GPIO_PCH_SLP_S0_L GPIO_SYS_SLP_S0IX_L #define GPIO_PCH_SLP_S3_L GPIO_SLP_S3_L -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* * GPIO_EC_PCH_INT_ODL is used for MKBP events as well as a PCH wakeup diff --git a/board/volteer/board.h b/board/volteer/board.h index 2d941549c5..5b4c835a6f 100644 --- a/board/volteer/board.h +++ b/board/volteer/board.h @@ -135,7 +135,6 @@ #define GPIO_USB_C1_BC12_INT_ODL GPIO_USB_C1_MIX_INT_ODL #define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL #define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* I2C Bus Configuration */ #define CONFIG_I2C diff --git a/board/voxel/board.h b/board/voxel/board.h index cd2b10ee6e..1ef0548210 100644 --- a/board/voxel/board.h +++ b/board/voxel/board.h @@ -139,7 +139,6 @@ #define GPIO_USB_C1_BC12_INT_ODL GPIO_USB_C1_MIX_INT_ODL #define GPIO_VOLUME_UP_L GPIO_EC_VOLUP_BTN_ODL #define GPIO_VOLUME_DOWN_L GPIO_EC_VOLDN_BTN_ODL -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L /* I2C Bus Configuration */ #define CONFIG_I2C diff --git a/board/willow/board.h b/board/willow/board.h index 9ec0b9483b..1fd6abd2ba 100644 --- a/board/willow/board.h +++ b/board/willow/board.h @@ -90,7 +90,7 @@ #define CONFIG_LED_ONOFF_STATES #undef CONFIG_GMR_TABLET_MODE -#undef GMR_TABLET_MODE_GPIO_L +#undef GPIO_TABLET_MODE_L #undef CONFIG_TABLET_MODE #undef CONFIG_TABLET_MODE_SWITCH diff --git a/board/woomax/board.h b/board/woomax/board.h index f5289f2bd1..ff74224181 100644 --- a/board/woomax/board.h +++ b/board/woomax/board.h @@ -73,7 +73,6 @@ #define GPIO_VOLUME_UP_L GPIO_VOLUP_BTN_ODL #define GPIO_WP_L GPIO_EC_WP_L #define GPIO_PACKET_MODE_EN GPIO_EC_H1_PACKET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L #ifndef __ASSEMBLER__ diff --git a/common/tablet_mode.c b/common/tablet_mode.c index 529078a448..d74222136c 100644 --- a/common/tablet_mode.c +++ b/common/tablet_mode.c @@ -100,9 +100,6 @@ void tablet_disable(void) /* This ifdef can be removed once we clean up past projects which do own init */ #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_GMR_SENSOR #error The board has GMR sensor #endif @@ -110,7 +107,7 @@ static void gmr_tablet_switch_interrupt_debounce(void) { gmr_sensor_at_360 = IS_ENABLED(CONFIG_GMR_TABLET_MODE_CUSTOM) ? board_sensor_at_360() - : !gpio_get_level(GMR_TABLET_MODE_GPIO_L); + : !gpio_get_level(GPIO_TABLET_MODE_L); /* * DPTF table is updated only when the board enters/exits completely @@ -159,7 +156,7 @@ static void gmr_tablet_switch_init(void) if (disabled) return; - gpio_enable_interrupt(GMR_TABLET_MODE_GPIO_L); + gpio_enable_interrupt(GPIO_TABLET_MODE_L); /* * Ensure tablet mode is initialized according to the hardware state * so that the cached state reflects reality. @@ -170,7 +167,7 @@ DECLARE_HOOK(HOOK_INIT, gmr_tablet_switch_init, HOOK_PRIO_DEFAULT); void gmr_tablet_switch_disable(void) { - gpio_disable_interrupt(GMR_TABLET_MODE_GPIO_L); + gpio_disable_interrupt(GPIO_TABLET_MODE_L); /* Cancel any pending debounce calls */ hook_call_deferred(&gmr_tablet_switch_interrupt_debounce_data, -1); tablet_disable(); diff --git a/include/config.h b/include/config.h index fc1e5ffd35..379422c2ed 100644 --- a/include/config.h +++ b/include/config.h @@ -3915,13 +3915,13 @@ /* * 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 + * board selects this config, it also needs to provide GPIO_TABLET_MODE_L * and direct its interrupt to gmr_tablet_switch_isr. */ #undef CONFIG_GMR_TABLET_MODE /* - * Board provides board_sensor_at_360 method instead of GMR_TABLET_MODE_GPIO_L + * Board provides board_sensor_at_360 method instead of GPIO_TABLET_MODE_L * as the means for determining the state of the flipped-360-degree mode. */ #undef CONFIG_GMR_TABLET_MODE_CUSTOM diff --git a/include/tablet_mode.h b/include/tablet_mode.h index 3e03d77f6a..6ad565628c 100644 --- a/include/tablet_mode.h +++ b/include/tablet_mode.h @@ -33,7 +33,7 @@ void tablet_disable(void); /** * Interrupt service routine for gmr sensor. * - * GMR_TABLET_MODE_GPIO_L must be defined. + * GPIO_TABLET_MODE_L must be defined. * * @param signal: GPIO signal */ @@ -50,7 +50,7 @@ void gmr_tablet_switch_disable(void); /** * 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). + * 360 sensor is active: !gpio_get_level(GPIO_TABLET_MODE_L). * * Returns 1 if the 360 sensor is active; otherwise 0. */ diff --git a/zephyr/Kconfig.motionsense b/zephyr/Kconfig.motionsense index 01a7eb1698..96f69d4848 100644 --- a/zephyr/Kconfig.motionsense +++ b/zephyr/Kconfig.motionsense @@ -136,7 +136,7 @@ config PLATFORM_EC_GMR_TABLET_MODE bool "Giant Magnetoresistance(GMR) Tablet Mode" help Enable this to use GMR sensor to detect tablet mode. - It requires to set GMR_TABLET_MODE_GPIO_L to map the interrupt from + It requires to set GPIO_TABLET_MODE_L to map the interrupt from the sensor and direct its mapping to gmr_tablet_switch_isr in common/tablet_mode.c. diff --git a/zephyr/projects/asurada/hayato/include/gpio_map.h b/zephyr/projects/asurada/hayato/include/gpio_map.h index eb99aeb2dc..28ce2e4269 100644 --- a/zephyr/projects/asurada/hayato/include/gpio_map.h +++ b/zephyr/projects/asurada/hayato/include/gpio_map.h @@ -12,10 +12,6 @@ #define GPIO_ENTERING_RW GPIO_UNIMPLEMENTED #define GPIO_WP_L GPIO_UNIMPLEMENTED -#ifdef CONFIG_PLATFORM_EC_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L -#endif - /* * Set EC_CROS_GPIO_INTERRUPTS to a space-separated list of GPIO_INT items. * diff --git a/zephyr/projects/brya/brya/include/gpio_map.h b/zephyr/projects/brya/brya/include/gpio_map.h index 7e3dc36e4c..d1fc03f940 100644 --- a/zephyr/projects/brya/brya/include/gpio_map.h +++ b/zephyr/projects/brya/brya/include/gpio_map.h @@ -33,7 +33,6 @@ #ifdef CONFIG_PLATFORM_EC_GMR_TABLET_MODE #define GMR_TABLET_MODE_INT(gpio, edge) GPIO_INT(gpio, edge, \ gmr_tablet_switch_isr) -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L #else #define GMR_TABLET_MODE_INT(gpio, edge) #endif diff --git a/zephyr/projects/corsola/include/gpio_map.h b/zephyr/projects/corsola/include/gpio_map.h index 474688e1e5..db78ceb3ea 100644 --- a/zephyr/projects/corsola/include/gpio_map.h +++ b/zephyr/projects/corsola/include/gpio_map.h @@ -141,10 +141,6 @@ #define USBA_INT() #endif -#ifdef CONFIG_PLATFORM_EC_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L -#endif - #ifdef CONFIG_PLATFORM_EC_ACCELGYRO_ICM42607 #define BASE_IMU_INT() GPIO_INT(GPIO_BASE_IMU_INT_L, \ GPIO_INT_EDGE_FALLING, \ diff --git a/zephyr/projects/herobrine/herobrine_npcx9/include/gpio_map.h b/zephyr/projects/herobrine/herobrine_npcx9/include/gpio_map.h index 00ab9bd98c..9796915947 100644 --- a/zephyr/projects/herobrine/herobrine_npcx9/include/gpio_map.h +++ b/zephyr/projects/herobrine/herobrine_npcx9/include/gpio_map.h @@ -9,10 +9,6 @@ #include <devicetree.h> #include <gpio_signal.h> -#ifdef CONFIG_PLATFORM_EC_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L -#endif - /* * Set EC_CROS_GPIO_INTERRUPTS to a space-separated list of GPIO_INT items. * diff --git a/zephyr/projects/trogdor/lazor/include/gpio_map.h b/zephyr/projects/trogdor/lazor/include/gpio_map.h index 00ee9c48e1..9d5dbfc129 100644 --- a/zephyr/projects/trogdor/lazor/include/gpio_map.h +++ b/zephyr/projects/trogdor/lazor/include/gpio_map.h @@ -9,10 +9,6 @@ #include <devicetree.h> #include <gpio_signal.h> -#ifdef CONFIG_PLATFORM_EC_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L -#endif - /* * Set EC_CROS_GPIO_INTERRUPTS to a space-separated list of GPIO_INT items. * diff --git a/zephyr/projects/trogdor/trogdor/include/gpio_map.h b/zephyr/projects/trogdor/trogdor/include/gpio_map.h index df4dcb0e25..3cf47f2056 100644 --- a/zephyr/projects/trogdor/trogdor/include/gpio_map.h +++ b/zephyr/projects/trogdor/trogdor/include/gpio_map.h @@ -9,10 +9,6 @@ #include <devicetree.h> #include <gpio_signal.h> -#ifdef CONFIG_PLATFORM_EC_GMR_TABLET_MODE -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L -#endif - /* * Set EC_CROS_GPIO_INTERRUPTS to a space-separated list of GPIO_INT items. * diff --git a/zephyr/projects/volteer/delbin/include/gpio_map.h b/zephyr/projects/volteer/delbin/include/gpio_map.h index 1f4b4e1ee0..ea1f186a6d 100644 --- a/zephyr/projects/volteer/delbin/include/gpio_map.h +++ b/zephyr/projects/volteer/delbin/include/gpio_map.h @@ -31,7 +31,6 @@ #ifdef CONFIG_PLATFORM_EC_GMR_TABLET_MODE #define GMR_TABLET_MODE_INT(gpio, edge) GPIO_INT(gpio, edge, \ gmr_tablet_switch_isr) -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L #else #define GMR_TABLET_MODE_INT(gpio, edge) #endif diff --git a/zephyr/projects/volteer/volteer/include/gpio_map.h b/zephyr/projects/volteer/volteer/include/gpio_map.h index fe6e8d08ee..c25d8e047f 100644 --- a/zephyr/projects/volteer/volteer/include/gpio_map.h +++ b/zephyr/projects/volteer/volteer/include/gpio_map.h @@ -62,7 +62,6 @@ #ifdef CONFIG_PLATFORM_EC_GMR_TABLET_MODE #define GMR_TABLET_MODE_INT(gpio, edge) GPIO_INT(gpio, edge, \ gmr_tablet_switch_isr) -#define GMR_TABLET_MODE_GPIO_L GPIO_TABLET_MODE_L #else #define GMR_TABLET_MODE_INT(gpio, edge) #endif |