|
1 | 1 | /* |
2 | | - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD |
| 2 | + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD |
3 | 3 | * |
4 | 4 | * SPDX-License-Identifier: Apache-2.0 |
5 | 5 | */ |
|
76 | 76 | #include "esp_private/sleep_console.h" |
77 | 77 | #include "esp_private/sleep_cpu.h" |
78 | 78 | #include "esp_private/sleep_modem.h" |
| 79 | +#include "esp_private/sleep_usb.h" |
79 | 80 | #include "esp_private/esp_clk.h" |
80 | 81 | #include "esp_private/esp_task_wdt.h" |
81 | 82 | #include "esp_private/sar_periph_ctrl.h" |
@@ -669,6 +670,11 @@ FORCE_INLINE_ATTR void misc_modules_sleep_prepare(uint32_t pd_flags, bool deep_s |
669 | 670 | // Only avoid USJ pad leakage here, USB OTG pad leakage is prevented through USB Host driver. |
670 | 671 | sleep_console_usj_pad_backup_and_disable(); |
671 | 672 | #endif |
| 673 | +#if SOC_USB_OTG_SUPPORTED && SOC_PM_SUPPORT_CNNT_PD |
| 674 | + if (!(pd_flags & PMU_SLEEP_PD_CNNT)) { |
| 675 | + sleep_usb_otg_phy_backup_and_disable(); |
| 676 | + } |
| 677 | +#endif |
672 | 678 | #if CONFIG_MAC_BB_PD |
673 | 679 | mac_bb_power_down_cb_execute(); |
674 | 680 | #endif |
@@ -720,6 +726,11 @@ FORCE_INLINE_ATTR void misc_modules_wake_prepare(uint32_t pd_flags) |
720 | 726 | #if SOC_USB_SERIAL_JTAG_SUPPORTED && !SOC_USB_SERIAL_JTAG_SUPPORT_LIGHT_SLEEP |
721 | 727 | sleep_console_usj_pad_restore(); |
722 | 728 | #endif |
| 729 | +#if SOC_USB_OTG_SUPPORTED && SOC_PM_SUPPORT_CNNT_PD |
| 730 | + if (!(pd_flags & PMU_SLEEP_PD_CNNT)) { |
| 731 | + sleep_usb_otg_phy_restore(); |
| 732 | + } |
| 733 | +#endif |
723 | 734 | #if !CONFIG_IDF_TARGET_ESP32C61 // TODO: IDF-9304 |
724 | 735 | sar_periph_ctrl_power_enable(); |
725 | 736 | #endif |
|
0 commit comments