From 0103bbcd9383518efeb153cb4b9cb9aef80353e1 Mon Sep 17 00:00:00 2001 From: Wai-Hong Tam Date: Mon, 16 Nov 2020 11:41:26 -0800 Subject: Coachz: Update the hall sensor GPIOs and interrupts Reflect the hall sensor change on the next hardware revision: * Wire GPIOD2, i.e. LID_OPEN_EC, to the lid hall sensor * Use GPIO73 as lid 360 detection * Different netnames * No reserse dock detection Add an empty interrupt for the kickstand hall sensors. Enable CONFIG_GMR_TABLET_MODE to handle lid 360. BRANCH=Trogdor BUG=b:168714440 TEST=Built the image correctly. Change-Id: I1eb35f6190c696e5a2598ef3ed7614c585c1173d Signed-off-by: Wai-Hong Tam Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2543110 Reviewed-by: Alexandru M Stan --- board/coachz/board.c | 6 ++++++ board/coachz/board.h | 2 ++ board/coachz/gpio.inc | 10 ++++------ 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/board/coachz/board.c b/board/coachz/board.c index d440c49113..b7911214d5 100644 --- a/board/coachz/board.c +++ b/board/coachz/board.c @@ -40,6 +40,7 @@ static void usb0_evt(enum gpio_signal signal); static void usb1_evt(enum gpio_signal signal); static void ppc_interrupt(enum gpio_signal signal); static void board_connect_c0_sbu(enum gpio_signal s); +static void ks_interrupt(enum gpio_signal s); #include "gpio_list.h" @@ -101,6 +102,11 @@ static void board_connect_c0_sbu(enum gpio_signal s) hook_call_deferred(&board_connect_c0_sbu_deferred_data, 0); } +static void ks_interrupt(enum gpio_signal s) +{ + /* TODO(b/168714440): Implement the interrupt */ +} + /* I2C port map */ const struct i2c_port_t i2c_ports[] = { {"power", I2C_PORT_POWER, 100, GPIO_EC_I2C_POWER_SCL, diff --git a/board/coachz/board.h b/board/coachz/board.h index 96644d4dc4..8d37c669f7 100644 --- a/board/coachz/board.h +++ b/board/coachz/board.h @@ -43,11 +43,13 @@ #define CONFIG_TABLET_MODE #define CONFIG_TABLET_MODE_SWITCH +#define CONFIG_GMR_TABLET_MODE /* GPIO alias */ #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 #ifndef __ASSEMBLER__ diff --git a/board/coachz/gpio.inc b/board/coachz/gpio.inc index 3da8ec8a8c..ec406b4fea 100644 --- a/board/coachz/gpio.inc +++ b/board/coachz/gpio.inc @@ -41,6 +41,9 @@ GPIO_INT(AP_EC_SPI_CS_L, PIN(5, 3), GPIO_INT_FALLING | GPIO_PULL_DOWN, shi_cs GPIO_INT(BASE_DET_L, PIN(3, 7), GPIO_INT_BOTH, base_detect_interrupt) /* Detachable base attached? */ /* Sensor interrupts */ +GPIO_INT(LID_360_L, PIN(7, 3), GPIO_INT_BOTH, gmr_tablet_switch_isr) +GPIO_INT(LID_INT_N_HALL1, PIN(D, 7), GPIO_INT_BOTH, ks_interrupt) /* Kickstand attached (0) or detached (1) */ +GPIO_INT(LID_INT_N_HALL2, PIN(6, 0), GPIO_INT_BOTH, ks_interrupt) /* Kickstand close (0) or open (1) */ GPIO_INT(ACCEL_GYRO_INT_L, PIN(A, 0), GPIO_INT_FALLING, bmi160_interrupt) /* Accelerometer/gyro interrupt */ /* @@ -64,12 +67,6 @@ GPIO(EN_PP3300_A, PIN(A, 6), GPIO_OUT_LOW) /* Enable PP3300 */ GPIO(EN_PP5000_A, PIN(6, 7), GPIO_OUT_LOW) /* Enable PP5000 */ GPIO(EC_BL_DISABLE_L, PIN(B, 6), GPIO_OUT_LOW) /* Backlight disable signal from EC */ -/* Sensors */ -GPIO(REVERSE_DOCK_EC, PIN(C, 6), GPIO_INPUT) -/* TODO(b/168714440): Implement the hall sensor interrupts */ -GPIO(LID_INT_N_HALL1, PIN(7, 3), GPIO_INPUT) -GPIO(LID_INT_N_HALL2, PIN(6, 0), GPIO_INPUT) -GPIO(LID_INT_N_HALL3, PIN(D, 7), GPIO_INPUT) /* TODO(waihong): Should remove it from hardware */ GPIO(CAM_LED, PIN(3, 0), GPIO_INPUT) @@ -178,6 +175,7 @@ UNUSED(PIN(7, 2)) UNUSED(PIN(8, 1)) UNUSED(PIN(7, 6)) UNUSED(PIN(3, 4)) +UNUSED(PIN(C, 6)) UNUSED(PIN(C, 0)) UNUSED(PIN(A, 3)) UNUSED(PIN(6, 2)) -- cgit v1.2.1