diff options
author | Diana Z <dzigterman@chromium.org> | 2023-04-20 10:57:48 -0600 |
---|---|---|
committer | Chromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-05-11 20:16:32 +0000 |
commit | 7f0fefb05c6d3518e3adafc9bda8fd7e50895f1a (patch) | |
tree | 72a56b58937c4e6e495a87f7497f858cd221d235 | |
parent | cca96dc838386324b609c149313fe546378f84bc (diff) | |
download | chrome-ec-7f0fefb05c6d3518e3adafc9bda8fd7e50895f1a.tar.gz |
Skyrim: Keep retimer enabled in suspend
The A1 retimer needs to remain enabled in suspend in order to prevent
issues with USB detection on resume. Enable and disable on the
transition into/out of S5 instead.
BUG=b:273849234,b:280957965
TEST=on frostflow, ensure USB file transfer is able to resume after
suspend
Change-Id: I0186d54a76c14f3d0141fbeec75ed5b13aa599d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4455299
Tested-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Diana Z <dzigterman@chromium.org>
Reviewed-by: Robert Zieba <robertzieba@google.com>
(cherry picked from commit 1dbb4df1fb4a11c9c0b6c95c34a4b6dedbd4e32f)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4467074
Commit-Queue: Jonathon Murphy <jpmurphy@google.com>
Reviewed-by: Chao Gui <chaogui@google.com>
Tested-by: Chao Gui <chaogui@google.com>
Reviewed-by: Jonathon Murphy <jpmurphy@google.com>
-rw-r--r-- | zephyr/program/skyrim/frostflow/src/usb_mux_config.c | 4 | ||||
-rw-r--r-- | zephyr/program/skyrim/src/power_signals.c | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/zephyr/program/skyrim/frostflow/src/usb_mux_config.c b/zephyr/program/skyrim/frostflow/src/usb_mux_config.c index b3d8c61f2e..99a665cadd 100644 --- a/zephyr/program/skyrim/frostflow/src/usb_mux_config.c +++ b/zephyr/program/skyrim/frostflow/src/usb_mux_config.c @@ -189,7 +189,7 @@ test_export_static void board_resume_change(struct ap_power_ev_callback *cb, default: return; - case AP_POWER_RESUME: + case AP_POWER_STARTUP: /* Any retimer tuning can be done after the retimer turns on */ hook_call_deferred(&baseboard_a1_retimer_setup_data, 20 * MSEC); break; @@ -201,7 +201,7 @@ void board_callback_init(void) static struct ap_power_ev_callback cb; /* Setup a resume callback */ - ap_power_ev_init_callback(&cb, board_resume_change, AP_POWER_RESUME); + ap_power_ev_init_callback(&cb, board_resume_change, AP_POWER_STARTUP); ap_power_ev_add_callback(&cb); } DECLARE_HOOK(HOOK_INIT, board_callback_init, HOOK_PRIO_DEFAULT); diff --git a/zephyr/program/skyrim/src/power_signals.c b/zephyr/program/skyrim/src/power_signals.c index b0919ae5f4..8af2d6bbcf 100644 --- a/zephyr/program/skyrim/src/power_signals.c +++ b/zephyr/program/skyrim/src/power_signals.c @@ -60,9 +60,13 @@ static void baseboard_suspend_change(struct ap_power_ev_callback *cb, return; case AP_POWER_SUSPEND: - /* Disable display backlight and retimer */ + /* Disable display backlight */ gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_ec_disable_disp_bl), 1); + break; + + case AP_POWER_SHUTDOWN: + /* Retimer disable */ ioex_set_level(IOEX_USB_A1_RETIMER_EN, 0); break; @@ -70,6 +74,9 @@ static void baseboard_suspend_change(struct ap_power_ev_callback *cb, /* Enable retimer and display backlight */ gpio_pin_set_dt(GPIO_DT_FROM_NODELABEL(gpio_ec_disable_disp_bl), 0); + break; + + case AP_POWER_STARTUP: ioex_set_level(IOEX_USB_A1_RETIMER_EN, 1); /* Any retimer tuning can be done after the retimer turns on */ break; @@ -101,7 +108,8 @@ static void baseboard_init(void) /* Setup a suspend/resume callback */ ap_power_ev_init_callback(&cb, baseboard_suspend_change, - AP_POWER_RESUME | AP_POWER_SUSPEND); + AP_POWER_STARTUP | AP_POWER_SHUTDOWN | + AP_POWER_RESUME | AP_POWER_SUSPEND); ap_power_ev_add_callback(&cb); /* Enable Power Group interrupts. */ gpio_enable_dt_interrupt(GPIO_INT_FROM_NODELABEL(int_pg_groupc_s0)); |