|
|
@@ -15,6 +15,7 @@
|
|
|
#include "soc/rtc.h"
|
|
|
#include "soc/pmu_struct.h"
|
|
|
#include "esp_private/esp_pmu.h"
|
|
|
+#include "esp32c6/rom/rtc.h"
|
|
|
|
|
|
#define HP(state) (PMU_MODE_HP_ ## state)
|
|
|
#define LP(state) (PMU_MODE_LP_ ## state)
|
|
|
@@ -152,11 +153,9 @@ const pmu_sleep_config_t* pmu_sleep_config_default(
|
|
|
config->digital = digital_default;
|
|
|
|
|
|
pmu_sleep_analog_config_t analog_default = PMU_SLEEP_ANALOG_LSLP_CONFIG_DEFAULT(pd_flags);
|
|
|
- if (!(pd_flags & PMU_SLEEP_PD_MODEM)){
|
|
|
- analog_default.hp_sys.analog.slp_logic_dbias += 2;
|
|
|
- }
|
|
|
- if (!(pd_flags & PMU_SLEEP_PD_TOP)){
|
|
|
- analog_default.hp_sys.analog.slp_logic_dbias += 2;
|
|
|
+ if (!(pd_flags & PMU_SLEEP_PD_TOP) || !(pd_flags & PMU_SLEEP_PD_MODEM)){
|
|
|
+ analog_default.hp_sys.analog.xpd = 1;
|
|
|
+ analog_default.hp_sys.analog.dbias = 2;
|
|
|
}
|
|
|
config->analog = analog_default;
|
|
|
}
|
|
|
@@ -200,10 +199,13 @@ static void pmu_sleep_analog_init(pmu_context_t *ctx, const pmu_sleep_analog_con
|
|
|
pmu_ll_hp_set_regulator_dbias (ctx->hal->dev, HP(SLEEP), analog->hp_sys.analog.dbias);
|
|
|
pmu_ll_hp_set_regulator_driver_bar (ctx->hal->dev, HP(SLEEP), analog->hp_sys.analog.drv_b);
|
|
|
|
|
|
+ pmu_ll_lp_set_regulator_slp_xpd (ctx->hal->dev, LP(ACTIVE), analog->lp_sys[LP(ACTIVE)].analog.slp_xpd);
|
|
|
pmu_ll_lp_set_regulator_sleep_dbias(ctx->hal->dev, LP(ACTIVE), analog->lp_sys[LP(ACTIVE)].analog.slp_dbias);
|
|
|
+ pmu_ll_lp_set_regulator_xpd (ctx->hal->dev, LP(ACTIVE), analog->lp_sys[LP(ACTIVE)].analog.xpd);
|
|
|
pmu_ll_lp_set_regulator_dbias (ctx->hal->dev, LP(ACTIVE), analog->lp_sys[LP(ACTIVE)].analog.dbias);
|
|
|
pmu_ll_lp_set_regulator_driver_bar (ctx->hal->dev, LP(ACTIVE), analog->lp_sys[LP(ACTIVE)].analog.drv_b);
|
|
|
|
|
|
+ pmu_ll_lp_set_dbg_atten (ctx->hal->dev, LP(SLEEP), analog->lp_sys[LP(SLEEP)].analog.dbg_atten);
|
|
|
pmu_ll_lp_set_current_power_off (ctx->hal->dev, LP(SLEEP), analog->lp_sys[LP(SLEEP)].analog.pd_cur);
|
|
|
pmu_ll_lp_set_bias_sleep_enable (ctx->hal->dev, LP(SLEEP), analog->lp_sys[LP(SLEEP)].analog.bias_sleep);
|
|
|
pmu_ll_lp_set_regulator_xpd (ctx->hal->dev, LP(SLEEP), analog->lp_sys[LP(SLEEP)].analog.xpd);
|