diff options
author | Edward Hill <ecgh@chromium.org> | 2020-08-18 20:58:52 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-08-22 07:37:58 +0000 |
commit | e5043bdc45a19593e07122ed725f917d8a0e5b00 (patch) | |
tree | 61b610a4d06fd6597b6401cb86dae608e9b73117 | |
parent | 74c97f675c063ae084c8d29ba9b2948adb0bc0ed (diff) | |
download | chrome-ec-e5043bdc45a19593e07122ed725f917d8a0e5b00.tar.gz |
Woomax: Fix HDMI retimer suspend / resume
BUG=b:163861706
BRANCH=none
TEST=none
Signed-off-by: Edward Hill <ecgh@chromium.org>
Change-Id: I8fda70cef671e3cdf14f6ea58e3890f82622237d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2364114
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
-rw-r--r-- | board/woomax/board.c | 45 |
1 files changed, 22 insertions, 23 deletions
diff --git a/board/woomax/board.c b/board/woomax/board.c index f74f3eb36e..98809ddc97 100644 --- a/board/woomax/board.c +++ b/board/woomax/board.c @@ -13,6 +13,7 @@ #include "driver/accel_kionix.h" #include "driver/accel_kx022.h" #include "driver/retimer/pi3dpx1207.h" +#include "driver/retimer/pi3hdx1204.h" #include "driver/retimer/ps8811.h" #include "driver/temp_sensor/sb_tsi.h" #include "driver/usb_mux/amd_fp5.h" @@ -197,17 +198,15 @@ const int usb_port_enable[USBA_PORT_COUNT] = { }; /***************************************************************************** - * USB-A Retimer tuning + * Board suspend / resume */ #define PS8811_ACCESS_RETRIES 2 -/* PS8811 gain tuning */ -static void ps8811_tuning_init(void) +static void board_chipset_resume(void) { int rv; int retry; - /* Turn on the retimers */ ioex_set_level(IOEX_USB_A0_RETIMER_EN, 1); /* USB-A0 can run with default settings */ @@ -222,17 +221,31 @@ static void ps8811_tuning_init(void) } if (rv) { ioex_set_level(IOEX_USB_A0_RETIMER_EN, 0); - CPRINTSUSB("C0: PS8811 not detected"); + CPRINTSUSB("A0: PS8811 not detected"); + } + + if (ec_config_has_hdmi_retimer_pi3hdx1204()) { + ioex_set_level(IOEX_HDMI_POWER_EN_DB, 1); + msleep(PI3HDX1204_POWER_ON_DELAY_MS); + pi3hdx1204_enable(I2C_PORT_TCPC1, + PI3HDX1204_I2C_ADDR_FLAGS, + 1); } } -DECLARE_HOOK(HOOK_CHIPSET_RESUME, ps8811_tuning_init, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT); -static void ps8811_retimer_off(void) +static void board_chipset_suspend(void) { - /* Turn on the retimers */ ioex_set_level(IOEX_USB_A0_RETIMER_EN, 0); + + if (ec_config_has_hdmi_retimer_pi3hdx1204()) { + pi3hdx1204_enable(I2C_PORT_TCPC1, + PI3HDX1204_I2C_ADDR_FLAGS, + 0); + ioex_set_level(IOEX_HDMI_POWER_EN_DB, 0); + } } -DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, ps8811_retimer_off, HOOK_PRIO_DEFAULT); +DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT); /***************************************************************************** * USB-C MUX/Retimer dynamic configuration @@ -450,20 +463,6 @@ static void setup_fans(void) } DECLARE_HOOK(HOOK_INIT, setup_fans, HOOK_PRIO_DEFAULT); -static void board_chipset_resume(void) -{ - /* HDMI retimer power on */ - ioex_set_level(IOEX_HDMI_POWER_EN_DB, 1); -} -DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT); - -static void board_chipset_suspend(void) -{ - /* HDMI retimer power off */ - ioex_set_level(IOEX_HDMI_POWER_EN_DB, 0); -} -DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT); - static const struct ec_response_keybd_config woomax_kb = { .num_top_row_keys = 10, .action_keys = { |