diff --git a/components/esp_hw_support/port/esp32c6/pmu_param.c b/components/esp_hw_support/port/esp32c6/pmu_param.c index 54c8dd70bc..00e6c89686 100644 --- a/components/esp_hw_support/port/esp32c6/pmu_param.c +++ b/components/esp_hw_support/port/esp32c6/pmu_param.c @@ -115,8 +115,8 @@ const pmu_hp_system_power_param_t * pmu_hp_system_power_param_default(pmu_hp_mod } #define PMU_HP_MODEM_CLOCK_CONFIG_DEFAULT() { \ - .icg_func = 0, \ - .icg_apb = 0, \ + .icg_func = BIT(PMU_ICG_FUNC_ENA_SARADC), \ + .icg_apb = BIT(PMU_ICG_APB_ENA_SARADC), \ .icg_modem = { \ .code = PMU_HP_ICG_MODEM_CODE_MODEM \ }, \ diff --git a/components/esp_phy/include/esp_private/phy.h b/components/esp_phy/include/esp_private/phy.h index 0981a54860..809716d386 100644 --- a/components/esp_phy/include/esp_private/phy.h +++ b/components/esp_phy/include/esp_private/phy.h @@ -1,10 +1,11 @@ /* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ #pragma once +#include "sdkconfig.h" #include "esp_phy_init.h" #ifdef __cplusplus @@ -180,6 +181,16 @@ _lock_t phy_get_lock(void); * */ void phy_track_pll(void); + +#if CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP +/** + * @brief On sleep->modem->active wakeup process, since RF has been turned on by hardware in + * modem state, `sleep_modem_wifi_do_phy_retention` and `phy_wakeup_init` will be skipped + * in `esp_phy_enable`, but there are still some configurations that need to be restored + * by software, which are packed in this function. + */ +void phy_wakeup_from_modem_state_extra_init(void); +#endif #ifdef __cplusplus } #endif diff --git a/components/esp_phy/src/phy_common.c b/components/esp_phy/src/phy_common.c index 759f3b5de8..fd27be3a30 100644 --- a/components/esp_phy/src/phy_common.c +++ b/components/esp_phy/src/phy_common.c @@ -1,14 +1,19 @@ /* - * SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2023-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ +#include +#include "sdkconfig.h" #include "esp_log.h" #include "esp_timer.h" #include "esp_phy_init.h" #include "esp_private/phy.h" -#include + +#if CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP +#include "hal/temperature_sensor_ll.h" +#endif static volatile uint16_t s_phy_modem_flag = 0; @@ -119,3 +124,10 @@ esp_phy_modem_t phy_get_modem_flag(void) { return s_phy_modem_flag; } + +#if CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP +void phy_wakeup_from_modem_state_extra_init(void) +{ + temperature_sensor_ll_enable(true); +} +#endif diff --git a/components/esp_phy/src/phy_init.c b/components/esp_phy/src/phy_init.c index 3158573937..2d6f62d8fd 100644 --- a/components/esp_phy/src/phy_init.c +++ b/components/esp_phy/src/phy_init.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -309,6 +309,8 @@ void esp_phy_enable(esp_phy_modem_t modem) } else { phy_wakeup_init(); } + } else { + phy_wakeup_from_modem_state_extra_init(); } #else phy_wakeup_init();