Trembyle: Fix HDMI retimer suspend / resume
BRANCH=none
TEST=none
#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"
@@ -184,12 +185,11 @@ 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;
@@ -210,7 +210,7 @@ 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");
}
/* USB-A1 needs to increase gain to get over MB/DB connector */
@@ -225,18 +225,29 @@ static void ps8811_tuning_init(void)
}
if (rv) {
ioex_set_level(IOEX_USB_A1_RETIMER_EN, 0);
- CPRINTSUSB("C1: PS8811 not detected");
+ CPRINTSUSB("A1: PS8811 not detected");
+ }
+
+ if (ec_config_has_hdmi_retimer_pi3hdx1204()) {
+ 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);
ioex_set_level(IOEX_USB_A1_RETIMER_EN, 0);
+
+ if (ec_config_has_hdmi_retimer_pi3hdx1204()) {
+ pi3hdx1204_enable(I2C_PORT_TCPC1,
+ PI3HDX1204_I2C_ADDR_FLAGS,
+ 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
