diff --git a/components/esp_hw_support/port/esp32c5/pmu_param.c b/components/esp_hw_support/port/esp32c5/pmu_param.c index 19888d4828..68ed37a63b 100644 --- a/components/esp_hw_support/port/esp32c5/pmu_param.c +++ b/components/esp_hw_support/port/esp32c5/pmu_param.c @@ -112,8 +112,8 @@ const pmu_hp_system_power_param_t * pmu_hp_system_power_param_default(pmu_hp_mod // TODOļ¼š PM-208 #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_hw_support/port/esp32c6/pmu_param.c b/components/esp_hw_support/port/esp32c6/pmu_param.c index 6b24a4c4d9..15184c698c 100644 --- a/components/esp_hw_support/port/esp32c6/pmu_param.c +++ b/components/esp_hw_support/port/esp32c6/pmu_param.c @@ -116,8 +116,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_hw_support/port/esp32c61/pmu_param.c b/components/esp_hw_support/port/esp32c61/pmu_param.c index 33af14a9f2..5a13d514a6 100644 --- a/components/esp_hw_support/port/esp32c61/pmu_param.c +++ b/components/esp_hw_support/port/esp32c61/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 f8a848dcb4..d2e508528b 100644 --- a/components/esp_phy/include/esp_private/phy.h +++ b/components/esp_phy/include/esp_private/phy.h @@ -6,6 +6,7 @@ #pragma once #include +#include "sdkconfig.h" #include "esp_phy_init.h" #ifdef __cplusplus @@ -232,6 +233,16 @@ uint32_t phy_ana_i2c_master_burst_bbpll_config(void); uint32_t phy_ana_i2c_master_burst_rf_onoff(bool on); #endif +#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 2a3ed122b3..3bfd4991d3 100644 --- a/components/esp_phy/src/phy_common.c +++ b/components/esp_phy/src/phy_common.c @@ -6,6 +6,7 @@ #include #include +#include "sdkconfig.h" #include "esp_timer.h" #include "esp_log.h" #include "esp_private/esp_gpio_reserve.h" @@ -17,6 +18,10 @@ #include "esp_phy.h" #include "esp_attr.h" +#if SOC_PM_SUPPORT_PMU_MODEM_STATE && CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP +#include "hal/temperature_sensor_ll.h" +#endif + static const char* TAG = "phy_comm"; static volatile uint16_t s_phy_modem_flag = 0; @@ -347,4 +352,11 @@ uint32_t phy_ana_i2c_master_burst_rf_onoff(bool on) return phy_ana_i2c_master_burst_config(cmd, size, on ? PHY_I2C_MST_CMD_TYPE_RF_ON : PHY_I2C_MST_CMD_TYPE_RF_OFF); } + +#if CONFIG_ESP_WIFI_ENHANCED_LIGHT_SLEEP +void phy_wakeup_from_modem_state_extra_init(void) +{ + temperature_sensor_ll_enable(true); +} +#endif #endif diff --git a/components/esp_phy/src/phy_init.c b/components/esp_phy/src/phy_init.c index bc8d28bf3f..ec7b6be4c8 100644 --- a/components/esp_phy/src/phy_init.c +++ b/components/esp_phy/src/phy_init.c @@ -312,6 +312,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(); @@ -335,10 +337,10 @@ void esp_phy_enable(esp_phy_modem_t modem) phy_track_pll_init(); #endif - if (phy_ant_need_update()) { - phy_ant_update(); - phy_ant_clr_update_flag(); - } + if (phy_ant_need_update()) { + phy_ant_update(); + phy_ant_clr_update_flag(); + } } phy_set_modem_flag(modem);