Skip to content

Commit bf874a8

Browse files
committed
refactor(esp_phy): refactor phy sleep data initialize, split it to support multiple targets
1 parent bd19d4b commit bf874a8

File tree

5 files changed

+215
-68
lines changed

5 files changed

+215
-68
lines changed

components/esp_phy/esp32c5/phy_init_data.c

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
*/
66

77
#include "sdkconfig.h"
8+
#include "soc/soc_caps.h"
89
#include "phy_init_data.h"
10+
#include "esp_private/phy.h"
11+
#include "esp_check.h"
912

1013

1114
const char __attribute__((section(".rodata"))) phy_init_magic_pre[] = PHY_INIT_MAGIC;
@@ -273,3 +276,69 @@ const esp_phy_init_data_t phy_init_data= { {
273276
} };
274277

275278
const char __attribute__((section(".rodata"))) phy_init_magic_post[] = PHY_INIT_MAGIC;
279+
280+
#if SOC_PM_MODEM_RETENTION_BY_REGDMA && CONFIG_MAC_BB_PD
281+
282+
#include "esp_private/sleep_retention.h"
283+
284+
static const char* TAG = "phy_sleep";
285+
286+
static esp_err_t sleep_retention_wifi_bb_init(void *arg)
287+
{
288+
#define N_REGS_WIFI_AGC() (126)
289+
#define N_REGS_WIFI_TX() (20)
290+
#define N_REGS_WIFI_NRX() (141)
291+
#define N_REGS_WIFI_BB() (63)
292+
#define N_REGS_WIFI_BRX() (39)
293+
#define N_REGS_WIFI_FE_COEX() (19)
294+
#define N_REGS_WIFI_FE_DATA() (31)
295+
#define N_REGS_WIFI_FE_CTRL() (55)
296+
297+
const static sleep_retention_entries_config_t bb_regs_retention[] = {
298+
[0] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b00, 0x600a7000, 0x600a7000, N_REGS_WIFI_AGC(), 0, 0), .owner = BIT(0) | BIT(1) }, /* AGC */
299+
[1] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b01, 0x600a7400, 0x600a7400, N_REGS_WIFI_TX(), 0, 0), .owner = BIT(0) | BIT(1) }, /* TX */
300+
[2] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b02, 0x600a7800, 0x600a7800, N_REGS_WIFI_NRX(), 0, 0), .owner = BIT(0) | BIT(1) }, /* NRX */
301+
[3] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b03, 0x600a7c00, 0x600a7c00, N_REGS_WIFI_BB(), 0, 0), .owner = BIT(0) | BIT(1) }, /* BB */
302+
[4] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b05, 0x600a0000, 0x600a0000, N_REGS_WIFI_FE_COEX(), 0, 0), .owner = BIT(0) | BIT(1) }, /* FE COEX */
303+
[5] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b06, 0x600a8000, 0x600a8000, N_REGS_WIFI_BRX(), 0, 0), .owner = BIT(0) | BIT(1) }, /* BRX */
304+
[6] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b07, 0x600a0400, 0x600a0400, N_REGS_WIFI_FE_DATA(), 0, 0), .owner = BIT(0) | BIT(1) }, /* FE DATA */
305+
[7] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b08, 0x600a0800, 0x600a0800, N_REGS_WIFI_FE_CTRL(), 0, 0), .owner = BIT(0) | BIT(1) }, /* FE CTRL */
306+
[8] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b09, 0x600a0c00, 0x600a0c00, 20, 0, 0), .owner = BIT(0) | BIT(1) } /* FE WIFI DATA */
307+
};
308+
esp_err_t err = sleep_retention_entries_create(bb_regs_retention, ARRAY_SIZE(bb_regs_retention), 3, SLEEP_RETENTION_MODULE_WIFI_BB);
309+
ESP_RETURN_ON_ERROR(err, TAG, "failed to allocate memory for modem (%s) retention", "WiFi BB");
310+
ESP_LOGD(TAG, "WiFi BB sleep retention initialization");
311+
return ESP_OK;
312+
}
313+
314+
void esp_phy_sleep_data_init(void)
315+
{
316+
sleep_retention_module_init_param_t init_param = {
317+
.cbs = { .create = { .handle = sleep_retention_wifi_bb_init, .arg = NULL } },
318+
.depends = RETENTION_MODULE_BITMAP_INIT(CLOCK_MODEM)
319+
};
320+
esp_err_t err = sleep_retention_module_init(SLEEP_RETENTION_MODULE_WIFI_BB, &init_param);
321+
if (err != ESP_OK) {
322+
ESP_LOGW(TAG, "WiFi BB sleep retention init failed");
323+
return;
324+
}
325+
err = sleep_retention_module_allocate(SLEEP_RETENTION_MODULE_WIFI_BB);
326+
if (err != ESP_OK) {
327+
ESP_LOGW(TAG, "failed to allocate sleep retention linked list for wifi bb retention");
328+
}
329+
}
330+
331+
void esp_phy_sleep_data_deinit(void)
332+
{
333+
esp_err_t err = sleep_retention_module_free(SLEEP_RETENTION_MODULE_WIFI_BB);
334+
if (err != ESP_OK) {
335+
ESP_LOGW(TAG, "failed to free sleep retention linked list for wifi bb retention");
336+
return;
337+
}
338+
err = sleep_retention_module_deinit(SLEEP_RETENTION_MODULE_WIFI_BB);
339+
if (err != ESP_OK) {
340+
ESP_LOGW(TAG, "WiFi BB sleep retention deinit failed");
341+
}
342+
}
343+
344+
#endif /* SOC_PM_MODEM_RETENTION_BY_REGDMA && CONFIG_MAC_BB_PD */

components/esp_phy/esp32c6/phy_init_data.c

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
*/
66

77
#include "sdkconfig.h"
8+
#include "soc/soc_caps.h"
89
#include "phy_init_data.h"
10+
#include "esp_private/phy.h"
11+
#include "esp_check.h"
912

1013
const char __attribute__((section(".rodata"))) phy_init_magic_pre[] = PHY_INIT_MAGIC;
1114

@@ -144,3 +147,63 @@ const esp_phy_init_data_t phy_init_data= { {
144147
} };
145148

146149
const char __attribute__((section(".rodata"))) phy_init_magic_post[] = PHY_INIT_MAGIC;
150+
151+
#if SOC_PM_MODEM_RETENTION_BY_REGDMA && CONFIG_MAC_BB_PD
152+
153+
#include "esp_private/sleep_retention.h"
154+
155+
static const char* TAG = "phy_sleep";
156+
157+
static esp_err_t sleep_retention_wifi_bb_init(void *arg)
158+
{
159+
#define N_REGS_WIFI_AGC() (121)
160+
#define N_REGS_WIFI_TX() (14)
161+
#define N_REGS_WIFI_NRX() (136)
162+
#define N_REGS_WIFI_BB() (53)
163+
#define N_REGS_WIFI_BRX() (39)
164+
#define N_REGS_WIFI_FE_COEX() (58)
165+
166+
const static sleep_retention_entries_config_t bb_regs_retention[] = {
167+
[0] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b00, 0x600a7000, 0x600a7000, N_REGS_WIFI_AGC(), 0, 0), .owner = BIT(0) | BIT(1) }, /* AGC */
168+
[1] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b01, 0x600a7400, 0x600a7400, N_REGS_WIFI_TX(), 0, 0), .owner = BIT(0) | BIT(1) }, /* TX */
169+
[2] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b02, 0x600a7800, 0x600a7800, N_REGS_WIFI_NRX(), 0, 0), .owner = BIT(0) | BIT(1) }, /* NRX */
170+
[3] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b03, 0x600a7c00, 0x600a7c00, N_REGS_WIFI_BB(), 0, 0), .owner = BIT(0) | BIT(1) }, /* BB */
171+
[4] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b05, 0x600a0000, 0x600a0000, N_REGS_WIFI_FE_COEX(), 0, 0), .owner = BIT(0) | BIT(1) }, /* FE COEX */
172+
};
173+
esp_err_t err = sleep_retention_entries_create(bb_regs_retention, ARRAY_SIZE(bb_regs_retention), 3, SLEEP_RETENTION_MODULE_WIFI_BB);
174+
ESP_RETURN_ON_ERROR(err, TAG, "failed to allocate memory for modem (%s) retention", "WiFi BB");
175+
ESP_LOGD(TAG, "WiFi BB sleep retention initialization");
176+
return ESP_OK;
177+
}
178+
179+
void esp_phy_sleep_data_init(void)
180+
{
181+
sleep_retention_module_init_param_t init_param = {
182+
.cbs = { .create = { .handle = sleep_retention_wifi_bb_init, .arg = NULL } },
183+
.depends = RETENTION_MODULE_BITMAP_INIT(CLOCK_MODEM)
184+
};
185+
esp_err_t err = sleep_retention_module_init(SLEEP_RETENTION_MODULE_WIFI_BB, &init_param);
186+
if (err != ESP_OK) {
187+
ESP_LOGW(TAG, "WiFi BB sleep retention init failed");
188+
return;
189+
}
190+
err = sleep_retention_module_allocate(SLEEP_RETENTION_MODULE_WIFI_BB);
191+
if (err != ESP_OK) {
192+
ESP_LOGW(TAG, "failed to allocate sleep retention linked list for wifi bb retention");
193+
}
194+
}
195+
196+
void esp_phy_sleep_data_deinit(void)
197+
{
198+
esp_err_t err = sleep_retention_module_free(SLEEP_RETENTION_MODULE_WIFI_BB);
199+
if (err != ESP_OK) {
200+
ESP_LOGW(TAG, "failed to free sleep retention linked list for wifi bb retention");
201+
return;
202+
}
203+
err = sleep_retention_module_deinit(SLEEP_RETENTION_MODULE_WIFI_BB);
204+
if (err != ESP_OK) {
205+
ESP_LOGW(TAG, "WiFi BB sleep retention deinit failed");
206+
}
207+
}
208+
209+
#endif /* SOC_PM_MODEM_RETENTION_BY_REGDMA && CONFIG_MAC_BB_PD */

components/esp_phy/esp32c61/phy_init_data.c

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@
55
*/
66

77
#include "sdkconfig.h"
8+
#include "soc/soc_caps.h"
89
#include "phy_init_data.h"
10+
#include "esp_private/phy.h"
11+
#include "esp_check.h"
912

1013

1114
const char __attribute__((section(".rodata"))) phy_init_magic_pre[] = PHY_INIT_MAGIC;
@@ -145,3 +148,68 @@ const esp_phy_init_data_t phy_init_data= { {
145148
} };
146149

147150
const char __attribute__((section(".rodata"))) phy_init_magic_post[] = PHY_INIT_MAGIC;
151+
152+
#if SOC_PM_MODEM_RETENTION_BY_REGDMA && CONFIG_MAC_BB_PD
153+
154+
#include "esp_private/sleep_retention.h"
155+
156+
static const char* TAG = "phy_sleep";
157+
158+
static esp_err_t sleep_retention_wifi_bb_init(void *arg)
159+
{
160+
#define N_REGS_WIFI_AGC() (121)
161+
#define N_REGS_WIFI_TX() (14)
162+
#define N_REGS_WIFI_NRX() (136)
163+
#define N_REGS_WIFI_BB() (53)
164+
#define N_REGS_WIFI_BRX() (39)
165+
#define N_REGS_WIFI_FE_COEX() (58)
166+
#define N_REGS_WIFI_FE_DATA() (41)
167+
#define N_REGS_WIFI_FE_CTRL() (87)
168+
169+
const static sleep_retention_entries_config_t bb_regs_retention[] = {
170+
[0] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b00, 0x600a7000, 0x600a7000, N_REGS_WIFI_AGC(), 0, 0), .owner = BIT(0) | BIT(1) }, /* AGC */
171+
[1] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b01, 0x600a7400, 0x600a7400, N_REGS_WIFI_TX(), 0, 0), .owner = BIT(0) | BIT(1) }, /* TX */
172+
[2] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b02, 0x600a7800, 0x600a7800, N_REGS_WIFI_NRX(), 0, 0), .owner = BIT(0) | BIT(1) }, /* NRX */
173+
[3] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b03, 0x600a7c00, 0x600a7c00, N_REGS_WIFI_BB(), 0, 0), .owner = BIT(0) | BIT(1) }, /* BB */
174+
[4] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b05, 0x600a0000, 0x600a0000, N_REGS_WIFI_FE_COEX(), 0, 0), .owner = BIT(0) | BIT(1) }, /* FE COEX */
175+
[5] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b06, 0x600a8000, 0x600a8000, N_REGS_WIFI_BRX(), 0, 0), .owner = BIT(0) | BIT(1) }, /* BRX */
176+
[6] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b07, 0x600a0400, 0x600a0400, N_REGS_WIFI_FE_DATA(), 0, 0), .owner = BIT(0) | BIT(1) }, /* FE DATA */
177+
[7] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b08, 0x600a0800, 0x600a0800, N_REGS_WIFI_FE_CTRL(), 0, 0), .owner = BIT(0) | BIT(1) }, /* FE CTRL */
178+
};
179+
esp_err_t err = sleep_retention_entries_create(bb_regs_retention, ARRAY_SIZE(bb_regs_retention), 3, SLEEP_RETENTION_MODULE_WIFI_BB);
180+
ESP_RETURN_ON_ERROR(err, TAG, "failed to allocate memory for modem (%s) retention", "WiFi BB");
181+
ESP_LOGD(TAG, "WiFi BB sleep retention initialization");
182+
return ESP_OK;
183+
}
184+
185+
void esp_phy_sleep_data_init(void)
186+
{
187+
sleep_retention_module_init_param_t init_param = {
188+
.cbs = { .create = { .handle = sleep_retention_wifi_bb_init, .arg = NULL } },
189+
.depends = RETENTION_MODULE_BITMAP_INIT(CLOCK_MODEM)
190+
};
191+
esp_err_t err = sleep_retention_module_init(SLEEP_RETENTION_MODULE_WIFI_BB, &init_param);
192+
if (err != ESP_OK) {
193+
ESP_LOGW(TAG, "WiFi BB sleep retention init failed");
194+
return;
195+
}
196+
err = sleep_retention_module_allocate(SLEEP_RETENTION_MODULE_WIFI_BB);
197+
if (err != ESP_OK) {
198+
ESP_LOGW(TAG, "failed to allocate sleep retention linked list for wifi bb retention");
199+
}
200+
}
201+
202+
void esp_phy_sleep_data_deinit(void)
203+
{
204+
esp_err_t err = sleep_retention_module_free(SLEEP_RETENTION_MODULE_WIFI_BB);
205+
if (err != ESP_OK) {
206+
ESP_LOGW(TAG, "failed to free sleep retention linked list for wifi bb retention");
207+
return;
208+
}
209+
err = sleep_retention_module_deinit(SLEEP_RETENTION_MODULE_WIFI_BB);
210+
if (err != ESP_OK) {
211+
ESP_LOGW(TAG, "WiFi BB sleep retention deinit failed");
212+
}
213+
}
214+
215+
#endif /* SOC_PM_MODEM_RETENTION_BY_REGDMA && CONFIG_MAC_BB_PD */

components/esp_phy/include/esp_private/phy.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <sys/lock.h>
99
#include "sdkconfig.h"
1010
#include "esp_phy_init.h"
11+
#include "soc/soc_caps.h"
1112

1213
#ifdef __cplusplus
1314
extern "C" {
@@ -243,6 +244,18 @@ uint32_t phy_ana_i2c_master_burst_rf_onoff(bool on);
243244
void phy_wakeup_from_modem_state_extra_init(void);
244245
#endif
245246

247+
#if SOC_PM_MODEM_RETENTION_BY_REGDMA && CONFIG_MAC_BB_PD
248+
/**
249+
* @brief PHY module sleep data (includes AGC, TX, NRX, BB, FE, etc..) initialize.
250+
*/
251+
void esp_phy_sleep_data_init(void);
252+
253+
/**
254+
* @brief PHY module sleep data de-initialize.
255+
*/
256+
void esp_phy_sleep_data_deinit(void);
257+
#endif
258+
246259
#ifdef __cplusplus
247260
}
248261
#endif

components/esp_phy/src/phy_init.c

Lines changed: 2 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,6 @@
5050
#endif
5151
#include "hal/efuse_hal.h"
5252

53-
#if SOC_PM_MODEM_RETENTION_BY_REGDMA
54-
#include "esp_private/sleep_retention.h"
55-
#endif
56-
5753
#if CONFIG_IDF_TARGET_ESP32
5854
extern wifi_mac_time_update_cb_t s_wifi_mac_time_update_cb;
5955
#endif
@@ -484,48 +480,6 @@ static uint32_t* s_mac_bb_pd_mem = NULL;
484480
static uint8_t s_macbb_backup_mem_ref = 0;
485481
/* Reference of powering down MAC and BB */
486482
static bool s_mac_bb_pu = true;
487-
#elif SOC_PM_MODEM_RETENTION_BY_REGDMA
488-
static esp_err_t sleep_retention_wifi_bb_init(void *arg)
489-
{
490-
#if CONFIG_IDF_TARGET_ESP32C6 || CONFIG_IDF_TARGET_ESP32C61
491-
#define N_REGS_WIFI_AGC() (121)
492-
#define N_REGS_WIFI_TX() (14)
493-
#define N_REGS_WIFI_NRX() (136)
494-
#define N_REGS_WIFI_BB() (53)
495-
#define N_REGS_WIFI_BRX() (39)
496-
#define N_REGS_WIFI_FE_COEX() (58)
497-
#define N_REGS_WIFI_FE_DATA() (41)
498-
#define N_REGS_WIFI_FE_CTRL() (87)
499-
#elif CONFIG_IDF_TARGET_ESP32C5
500-
#define N_REGS_WIFI_AGC() (126)
501-
#define N_REGS_WIFI_TX() (20)
502-
#define N_REGS_WIFI_NRX() (141)
503-
#define N_REGS_WIFI_BB() (63)
504-
#define N_REGS_WIFI_BRX() (39)
505-
#define N_REGS_WIFI_FE_COEX() (19)
506-
#define N_REGS_WIFI_FE_DATA() (31)
507-
#define N_REGS_WIFI_FE_CTRL() (55)
508-
#endif
509-
const static sleep_retention_entries_config_t bb_regs_retention[] = {
510-
[0] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b00, 0x600a7000, 0x600a7000, N_REGS_WIFI_AGC(), 0, 0), .owner = BIT(0) | BIT(1) }, /* AGC */
511-
[1] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b01, 0x600a7400, 0x600a7400, N_REGS_WIFI_TX(), 0, 0), .owner = BIT(0) | BIT(1) }, /* TX */
512-
[2] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b02, 0x600a7800, 0x600a7800, N_REGS_WIFI_NRX(), 0, 0), .owner = BIT(0) | BIT(1) }, /* NRX */
513-
[3] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b03, 0x600a7c00, 0x600a7c00, N_REGS_WIFI_BB(), 0, 0), .owner = BIT(0) | BIT(1) }, /* BB */
514-
[4] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b05, 0x600a0000, 0x600a0000, N_REGS_WIFI_FE_COEX(), 0, 0), .owner = BIT(0) | BIT(1) }, /* FE COEX */
515-
#ifndef SOC_PM_RETENTION_HAS_CLOCK_BUG
516-
[5] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b06, 0x600a8000, 0x600a8000, N_REGS_WIFI_BRX(), 0, 0), .owner = BIT(0) | BIT(1) }, /* BRX */
517-
[6] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b07, 0x600a0400, 0x600a0400, N_REGS_WIFI_FE_DATA(), 0, 0), .owner = BIT(0) | BIT(1) }, /* FE DATA */
518-
[7] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b08, 0x600a0800, 0x600a0800, N_REGS_WIFI_FE_CTRL(), 0, 0), .owner = BIT(0) | BIT(1) }, /* FE CTRL */
519-
#endif
520-
#if CONFIG_IDF_TARGET_ESP32C5
521-
[8] = { .config = REGDMA_LINK_CONTINUOUS_INIT(0x0b09, 0x600a0c00, 0x600a0c00, 20, 0, 0), .owner = BIT(0) | BIT(1) } /* FE WIFI DATA */
522-
#endif
523-
};
524-
esp_err_t err = sleep_retention_entries_create(bb_regs_retention, ARRAY_SIZE(bb_regs_retention), 3, SLEEP_RETENTION_MODULE_WIFI_BB);
525-
ESP_RETURN_ON_ERROR(err, TAG, "failed to allocate memory for modem (%s) retention", "WiFi BB");
526-
ESP_LOGD(TAG, "WiFi BB sleep retention initialization");
527-
return ESP_OK;
528-
}
529483
#endif // SOC_PM_MODEM_RETENTION_BY_BACKUPDMA
530484

531485
void esp_mac_bb_pd_mem_init(void)
@@ -538,19 +492,7 @@ void esp_mac_bb_pd_mem_init(void)
538492
}
539493
_lock_release(&s_phy_access_lock);
540494
#elif SOC_PM_MODEM_RETENTION_BY_REGDMA
541-
sleep_retention_module_init_param_t init_param = {
542-
.cbs = { .create = { .handle = sleep_retention_wifi_bb_init, .arg = NULL } },
543-
.depends = RETENTION_MODULE_BITMAP_INIT(CLOCK_MODEM)
544-
};
545-
esp_err_t err = sleep_retention_module_init(SLEEP_RETENTION_MODULE_WIFI_BB, &init_param);
546-
if (err != ESP_OK) {
547-
ESP_LOGW(TAG, "WiFi BB sleep retention init failed");
548-
return;
549-
}
550-
err = sleep_retention_module_allocate(SLEEP_RETENTION_MODULE_WIFI_BB);
551-
if (err != ESP_OK) {
552-
ESP_LOGW(TAG, "failed to allocate sleep retention linked list for wifi bb retention");
553-
}
495+
esp_phy_sleep_data_init();
554496
#endif
555497
}
556498

@@ -565,15 +507,7 @@ void esp_mac_bb_pd_mem_deinit(void)
565507
}
566508
_lock_release(&s_phy_access_lock);
567509
#elif SOC_PM_MODEM_RETENTION_BY_REGDMA
568-
esp_err_t err = sleep_retention_module_free(SLEEP_RETENTION_MODULE_WIFI_BB);
569-
if (err != ESP_OK) {
570-
ESP_LOGW(TAG, "failed to free sleep retention linked list for wifi bb retention");
571-
return;
572-
}
573-
err = sleep_retention_module_deinit(SLEEP_RETENTION_MODULE_WIFI_BB);
574-
if (err != ESP_OK) {
575-
ESP_LOGW(TAG, "WiFi BB sleep retention deinit failed");
576-
}
510+
esp_phy_sleep_data_deinit();
577511
#endif
578512
}
579513

0 commit comments

Comments
 (0)