Berknip: Fix HDMI retimer suspend / resume
BRANCH=none
TEST=none
#include "driver/accelgyro_bmi_common.h"
#include "driver/accel_kionix.h"
#include "driver/accel_kx022.h"
+#include "driver/retimer/pi3hdx1204.h"
#include "driver/retimer/tusb544.h"
#include "driver/temp_sensor/sb_tsi.h"
#include "driver/usb_mux/amd_fp5.h"
@@ -161,22 +162,31 @@ const int usb_port_enable[USBA_PORT_COUNT] = {
};
/*****************************************************************************
- * Retimers
+ * Board suspend / resume
*/
-static void retimers_on(void)
+static void board_chipset_resume(void)
{
- /* hdmi retimer power on */
+ 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, retimers_on, HOOK_PRIO_DEFAULT);
+}
+DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT);
-static void retimers_off(void)
+static void board_chipset_suspend(void)
{
- /* hdmi retimer power off */
+ 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, retimers_off, HOOK_PRIO_DEFAULT);
+}
+DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_chipset_suspend, HOOK_PRIO_DEFAULT);
/*
* USB C0 port SBU mux use standalone PI3USB221
