diff options
author | Shelley Chen <shchen@google.com> | 2021-04-16 06:24:17 +0000 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-30 23:47:10 +0000 |
commit | 7d2eebe8c7d4c59df993218cfcba2616f20fc8a4 (patch) | |
tree | fa739632f4770ebc56b198a8e99fe63a937953fa /board | |
parent | e760fc012a6e1d35ba719125a9570a2bf1f15164 (diff) | |
download | chrome-ec-7d2eebe8c7d4c59df993218cfcba2616f20fc8a4.tar.gz |
kindred: Set TCPC_AUX_SWITCH to 0xC on Port 0 on CCD enable
When the screen brightness is changed, DP sends signal on AUX channel.
This causes CCD mode to be disconnected.
This patch sets the MUX to aux+ <-> sbu2, aux- <-> sbu1 to fix it.
Same change as I3dba1bdfd44a921077a2f60dec17119bb0077238
BUG=b:185137814
BRANCH=hatch
TEST=manually verify servod doesn't exit when screen turns off due
to the device being idle for too long
Signed-off-by: Shelley Chen <shchen@google.com>
Change-Id: Ie1edef535297c68b7e91e247caaeb7ad00d19392
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2831053
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Shelley Chen <shchen@chromium.org>
Tested-by: Shelley Chen <shchen@chromium.org>
Diffstat (limited to 'board')
-rw-r--r-- | board/kindred/board.c | 27 | ||||
-rw-r--r-- | board/kindred/board.h | 3 | ||||
-rw-r--r-- | board/kindred/gpio.inc | 3 |
3 files changed, 33 insertions, 0 deletions
diff --git a/board/kindred/board.c b/board/kindred/board.c index 4cd49ea312..c704fd87d3 100644 --- a/board/kindred/board.c +++ b/board/kindred/board.c @@ -529,12 +529,39 @@ static void board_update_sensor_config_from_sku(void) } } +static void anx7447_set_aux_switch(void) +{ + const int port = USB_PD_PORT_TCPC_0; + + /* Debounce */ + if (gpio_get_level(GPIO_CCD_MODE_ODL)) + return; + + /* + * Expect to set AUX_SWITCH to 0, but 0xc isolates the DP_AUX + * signal from SBU. + */ + CPRINTS("C%d: AUX_SW_SEL=0x%x", port, 0xc); + if (tcpc_write(port, ANX7447_REG_TCPC_AUX_SWITCH, 0xc)) + CPRINTS("C%d: Setting AUX_SW_SEL failed", port); +} +DECLARE_DEFERRED(anx7447_set_aux_switch); + +void ccd_mode_isr(enum gpio_signal signal) +{ + /* Wait 2 seconds until all mux setting is done by PD task */ + hook_call_deferred(&anx7447_set_aux_switch_data, 2 * SECOND); +} + static void board_init(void) { /* Initialize Fans */ setup_fans(); /* Enable HDMI HPD interrupt. */ gpio_enable_interrupt(GPIO_HDMI_CONN_HPD); + /* Trigger once to set mux in case CCD cable is already connected. */ + ccd_mode_isr(GPIO_CCD_MODE_ODL); + gpio_enable_interrupt(GPIO_CCD_MODE_ODL); /* Select correct gpio signal for PP5000_A control */ board_gpio_set_pp5000(); /* Use sku_id to set motion sensor count */ diff --git a/board/kindred/board.h b/board/kindred/board.h index 0cc2e7d0ba..99bdce09a9 100644 --- a/board/kindred/board.h +++ b/board/kindred/board.h @@ -182,6 +182,9 @@ enum battery_type { extern const int keyboard_factory_scan_pins[][2]; extern const int keyboard_factory_scan_pins_used; void motion_interrupt(enum gpio_signal signal); + +void ccd_mode_isr(enum gpio_signal signal); + #endif /* !__ASSEMBLER__ */ #endif /* __CROS_EC_BOARD_H */ diff --git a/board/kindred/gpio.inc b/board/kindred/gpio.inc index 2b749dffde..2adb08f564 100644 --- a/board/kindred/gpio.inc +++ b/board/kindred/gpio.inc @@ -37,6 +37,9 @@ GPIO_INT(USB_C1_TCPC_INT_ODL, PIN(F, 5), GPIO_INT_FALLING, tcpc_alert_event) GPIO_INT(USB_C0_BC12_INT_ODL, PIN(9, 5), GPIO_INT_FALLING, bc12_interrupt) GPIO_INT(USB_C1_BC12_INT_ODL, PIN(E, 4), GPIO_INT_FALLING, bc12_interrupt) +/* CCD mode line*/ +GPIO_INT(CCD_MODE_ODL, PIN(E, 5), GPIO_INT_FALLING, ccd_mode_isr) + GPIO_INT(HDMI_CONN_HPD, PIN(7, 2), GPIO_INT_BOTH, hdmi_hpd_interrupt) /* Volume button interrupts */ |