Merge branch 'fix/fix_usb_hs_phy_leakage_on_deepsleep_v5.3' into 'release/v5.3'

fix(esp_hw_support): Fix deepsleep leakage after initializing USB HS phy (v5.3)

See merge request espressif/esp-idf!39169
This commit is contained in:
Jiang Jiang Jian
2025-05-26 19:56:41 +08:00
6 changed files with 49 additions and 4 deletions
+11
View File
@@ -21,6 +21,11 @@
#include "hal/gpio_ll.h"
#include "soc/soc_caps.h"
#if SOC_USB_UTMI_PHY_NO_POWER_OFF_ISO
#include "esp_private/sleep_usb.h"
#include "esp_sleep.h"
#endif
#if !SOC_RCC_IS_INDEPENDENT
#define USB_PHY_RCC_ATOMIC() PERIPH_RCC_ATOMIC()
#else
@@ -298,6 +303,12 @@ esp_err_t usb_new_phy(const usb_phy_config_t *config, usb_phy_handle_t *handle_r
}
#endif
#if SOC_USB_UTMI_PHY_NO_POWER_OFF_ISO
if (phy_target == USB_PHY_TARGET_UTMI) {
esp_deep_sleep_register_hook(&sleep_usb_suppress_deepsleep_leakage);
}
#endif
ESP_RETURN_ON_FALSE(config, ESP_ERR_INVALID_ARG, USBPHY_TAG, "config argument is invalid");
ESP_RETURN_ON_FALSE(phy_target < USB_PHY_TARGET_MAX, ESP_ERR_INVALID_ARG, USBPHY_TAG, "specified PHY argument is invalid");
ESP_RETURN_ON_FALSE(config->controller < USB_PHY_CTRL_MAX, ESP_ERR_INVALID_ARG, USBPHY_TAG, "specified source argument is invalid");