Merge branch 'fix/fix_tsens_power_after_modem_wakeup_v5.2' into 'release/v5.2'

fix(esp_hw_support): fix tsensor power enable failed after modem state wakeup (v5.2)

See merge request espressif/esp-idf!36226
This commit is contained in:
Jiang Jiang Jian 2025-01-16 20:30:54 +08:00
commit 8775d06702
4 changed files with 31 additions and 6 deletions

View File

@ -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 \
}, \

View File

@ -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

View File

@ -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 <stdint.h>
#include "sdkconfig.h"
#include "esp_log.h"
#include "esp_timer.h"
#include "esp_phy_init.h"
#include "esp_private/phy.h"
#include <stdint.h>
#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

View File

@ -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();