diff --git a/components/driver/i2c/i2c.c b/components/driver/i2c/i2c.c index bd0475017c..591177dda8 100644 --- a/components/driver/i2c/i2c.c +++ b/components/driver/i2c/i2c.c @@ -276,7 +276,7 @@ static void i2c_hw_enable(i2c_port_t i2c_num) I2C_EXIT_CRITICAL(&(i2c_context[i2c_num].spinlock)); } -#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP +#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && SOC_I2C_SUPPORT_SLEEP_RETENTION static esp_err_t i2c_sleep_retention_init(void *arg) { i2c_port_t i2c_num = *(i2c_port_t *)arg; @@ -424,7 +424,7 @@ esp_err_t i2c_driver_install(i2c_port_t i2c_num, i2c_mode_t mode, size_t slv_rx_ } #endif // SOC_I2C_SUPPORT_SLAVE -#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && !CONFIG_IDF_TARGET_ESP32P4 // TODO: IDF-9353 +#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && SOC_I2C_SUPPORT_SLEEP_RETENTION sleep_retention_module_init_param_t init_param = { .cbs = { .create = { .handle = i2c_sleep_retention_init, .arg = &i2c_num } } }; @@ -485,7 +485,7 @@ esp_err_t i2c_driver_delete(i2c_port_t i2c_num) esp_intr_free(p_i2c->intr_handle); p_i2c->intr_handle = NULL; -#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && !CONFIG_IDF_TARGET_ESP32P4 // TODO: IDF-9353 +#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && SOC_I2C_SUPPORT_SLEEP_RETENTION esp_err_t err = sleep_retention_module_free(I2C_SLEEP_RETENTION_MODULE(i2c_num)); if (err == ESP_OK) { err = sleep_retention_module_deinit(I2C_SLEEP_RETENTION_MODULE(i2c_num)); diff --git a/components/esp_driver_i2c/i2c_common.c b/components/esp_driver_i2c/i2c_common.c index fea6f4d139..f0daf1a3b8 100644 --- a/components/esp_driver_i2c/i2c_common.c +++ b/components/esp_driver_i2c/i2c_common.c @@ -47,7 +47,7 @@ typedef struct i2c_platform_t { static i2c_platform_t s_i2c_platform = {}; // singleton platform -#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP +#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && SOC_I2C_SUPPORT_SLEEP_RETENTION static esp_err_t s_i2c_sleep_retention_init(void *arg) { i2c_bus_t *bus = (i2c_bus_t *)arg; @@ -77,7 +77,7 @@ static esp_err_t s_i2c_bus_handle_acquire(i2c_port_num_t port_num, i2c_bus_handl bus->bus_mode = mode; bus->is_lp_i2c = (bus->port_num < SOC_HP_I2C_NUM) ? false : true; -#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && !CONFIG_IDF_TARGET_ESP32P4 // TODO: IDF-9353 +#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && SOC_I2C_SUPPORT_SLEEP_RETENTION if (bus->is_lp_i2c == false) { sleep_retention_module_init_param_t init_param = { .cbs = { .create = { .handle = s_i2c_sleep_retention_init, .arg = (void *)bus } } @@ -175,7 +175,7 @@ esp_err_t i2c_release_bus_handle(i2c_bus_handle_t i2c_bus) if (s_i2c_platform.count[port_num] == 0) { do_deinitialize = true; s_i2c_platform.buses[port_num] = NULL; -#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && !CONFIG_IDF_TARGET_ESP32P4 // TODO: IDF-9353 +#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && SOC_I2C_SUPPORT_SLEEP_RETENTION if (i2c_bus->is_lp_i2c == false) { esp_err_t err = sleep_retention_module_free(I2C_SLEEP_RETENTION_MODULE(port_num)); if (err == ESP_OK) { diff --git a/components/soc/esp32c5/beta3/include/soc/soc_caps.h b/components/soc/esp32c5/beta3/include/soc/soc_caps.h index 5ddc42d77d..0f5f9f6613 100644 --- a/components/soc/esp32c5/beta3/include/soc/soc_caps.h +++ b/components/soc/esp32c5/beta3/include/soc/soc_caps.h @@ -254,6 +254,8 @@ #define SOC_I2C_SLAVE_CAN_GET_STRETCH_CAUSE (1) #define SOC_I2C_SLAVE_SUPPORT_I2CRAM_ACCESS (1) +// #define SOC_I2C_SUPPORT_SLEEP_RETENTION (1) // TODO: IDF-9693 + /*-------------------------- LP_I2C CAPS -------------------------------------*/ // ESP32-C5 has 1 LP_I2C // #define SOC_LP_I2C_NUM (1U) diff --git a/components/soc/esp32c5/beta3/include/soc/system_periph_retention.h b/components/soc/esp32c5/beta3/include/soc/system_periph_retention.h index 9beb56b644..b0cafd51bf 100644 --- a/components/soc/esp32c5/beta3/include/soc/system_periph_retention.h +++ b/components/soc/esp32c5/beta3/include/soc/system_periph_retention.h @@ -15,10 +15,10 @@ extern "C" { #endif -#if SOC_PAU_SUPPORTED // TODO: [ESP32C5] IDF-8640 +#if SOC_PAU_SUPPORTED /** * @brief Provide access to interrupt matrix configuration registers retention - * context defination. + * context definition. * * This is an internal function of the sleep retention driver, and is not * useful for external use. @@ -28,7 +28,7 @@ extern const regdma_entries_config_t intr_matrix_regs_retention[INT_MTX_RETENTIO /** * @brief Provide access to hp_system configuration registers retention - * context defination. + * context definition. * * This is an internal function of the sleep retention driver, and is not * useful for external use. @@ -38,7 +38,7 @@ extern const regdma_entries_config_t hp_system_regs_retention[HP_SYSTEM_RETENTIO /** * @brief Provide access to TEE_APM configuration registers retention - * context defination. + * context definition. * * This is an internal function of the sleep retention driver, and is not * useful for external use. @@ -50,7 +50,7 @@ extern const regdma_entries_config_t tee_apm_highpri_regs_retention[TEE_APM_HIGH /** * @brief Provide access to uart configuration registers retention - * context defination. + * context definition. * * This is an internal function of the sleep retention driver, and is not * useful for external use. @@ -60,7 +60,7 @@ extern const regdma_entries_config_t uart_regs_retention[UART_RETENTION_LINK_LEN /** * @brief Provide access to timer group configuration registers retention - * context defination. + * context definition. * * This is an internal function of the sleep retention driver, and is not * useful for external use. @@ -70,7 +70,7 @@ extern const regdma_entries_config_t tg_regs_retention[TIMG_RETENTION_LINK_LEN]; /** * @brief Provide access to IOMUX configuration registers retention - * context defination. + * context definition. * * This is an internal function of the sleep retention driver, and is not * useful for external use. @@ -80,7 +80,7 @@ extern const regdma_entries_config_t iomux_regs_retention[IOMUX_RETENTION_LINK_L /** * @brief Provide access to spimem configuration registers retention - * context defination. + * context definition. * * This is an internal function of the sleep retention driver, and is not * useful for external use. @@ -90,7 +90,7 @@ extern const regdma_entries_config_t spimem_regs_retention[SPIMEM_RETENTION_LINK /** * @brief Provide access to systimer configuration registers retention - * context defination. + * context definition. * * This is an internal function of the sleep retention driver, and is not * useful for external use. diff --git a/components/soc/esp32c5/mp/include/soc/soc_caps.h b/components/soc/esp32c5/mp/include/soc/soc_caps.h index 8f5f7a1eac..aefa9008bc 100644 --- a/components/soc/esp32c5/mp/include/soc/soc_caps.h +++ b/components/soc/esp32c5/mp/include/soc/soc_caps.h @@ -245,6 +245,8 @@ // #define SOC_I2C_SLAVE_SUPPORT_I2CRAM_ACCESS (1) // #define SOC_I2C_SLAVE_SUPPORT_SLAVE_UNMATCH (1) +// #define SOC_I2C_SUPPORT_SLEEP_RETENTION (1) // TODO: IDF-9693 + /*-------------------------- LP_I2C CAPS -------------------------------------*/ // ESP32-C5 has 1 LP_I2C // #define SOC_LP_I2C_NUM (1U) diff --git a/components/soc/esp32p4/include/soc/soc_caps.h b/components/soc/esp32p4/include/soc/soc_caps.h index 81371dbc3c..248e45b8bd 100644 --- a/components/soc/esp32p4/include/soc/soc_caps.h +++ b/components/soc/esp32p4/include/soc/soc_caps.h @@ -273,6 +273,8 @@ #define SOC_I2C_SLAVE_SUPPORT_I2CRAM_ACCESS (1) #define SOC_I2C_SLAVE_SUPPORT_SLAVE_UNMATCH (1) +// #define SOC_I2C_SUPPORT_SLEEP_RETENTION (1) // TODO: IDF-9353 + /*-------------------------- LP_I2C CAPS -------------------------------------*/ // ESP32-P4 has 1 LP_I2C #define SOC_LP_I2C_NUM (1U)