mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
Merge branch 'fix/fix_i2c_modem_clock_ref_count_mismatch_v6.0' into 'release/v6.0'
feat(esp_hw_support): add reference count control & clock enable checking for modem clock devices (v6.0) See merge request espressif/esp-idf!45533
This commit is contained in:
@@ -25,6 +25,12 @@ static inline void modem_lpcon_ll_enable_test_clk(modem_lpcon_dev_t *hw, bool en
|
||||
hw->test_conf.clk_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_lpcon_ll_test_clk_is_enabled(modem_lpcon_dev_t *hw)
|
||||
{
|
||||
return hw->test_conf.clk_en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_coex_lpclk_slow_osc(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
@@ -67,12 +73,24 @@ static inline void modem_lpcon_ll_enable_coex_clock(modem_lpcon_dev_t *hw, bool
|
||||
hw->clk_conf.clk_coex_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_lpcon_ll_coex_clock_is_enabled(modem_lpcon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf.clk_coex_en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_fe_mem_clock(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf.clk_fe_mem_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_lpcon_ll_fe_mem_clock_is_enabled(modem_lpcon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf.clk_fe_mem_en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_lpcon_ll_enable_coex_force_clock(modem_lpcon_dev_t *hw, bool en)
|
||||
{
|
||||
|
||||
@@ -25,6 +25,12 @@ static inline void modem_syscon_ll_enable_test_clk(modem_syscon_dev_t *hw, bool
|
||||
hw->test_conf.clk_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_syscon_ll_test_clk_is_enabled(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->test_conf.clk_en;
|
||||
}
|
||||
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_data_dump_mux_clock(modem_syscon_dev_t *hw, bool en)
|
||||
@@ -32,24 +38,49 @@ static inline void modem_syscon_ll_enable_data_dump_mux_clock(modem_syscon_dev_t
|
||||
// ESP32-H21 Not Support
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_syscon_ll_data_dump_mux_clock_is_enabled(modem_syscon_dev_t *hw)
|
||||
{
|
||||
// ESP32-H21 Not Support
|
||||
return true;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_etm_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf.clk_etm_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_syscon_ll_etm_clock_is_enabled(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf.clk_etm_en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_ieee802154_apb_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf.clk_zb_apb_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_syscon_ll_ieee802154_apb_clock_is_enabled(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf.clk_zb_apb_en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_ieee802154_mac_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf.clk_zb_mac_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_syscon_ll_ieee802154_mac_clock_is_enabled(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf.clk_zb_mac_en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
@@ -60,6 +91,16 @@ static inline void modem_syscon_ll_enable_modem_sec_clock(modem_syscon_dev_t *hw
|
||||
hw->clk_conf.clk_modem_sec_apb_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_syscon_ll_modem_sec_clock_is_enabled(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf.clk_modem_sec_en &&
|
||||
hw->clk_conf.clk_modem_sec_ecb_en &&
|
||||
hw->clk_conf.clk_modem_sec_ccm_en &&
|
||||
hw->clk_conf.clk_modem_sec_bah_en &&
|
||||
hw->clk_conf.clk_modem_sec_apb_en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_ble_timer_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
@@ -67,12 +108,25 @@ static inline void modem_syscon_ll_enable_ble_timer_clock(modem_syscon_dev_t *hw
|
||||
hw->clk_conf.clk_ble_timer_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_syscon_ll_ble_timer_clock_is_enabled(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf.clk_ble_timer_apb_en &&
|
||||
hw->clk_conf.clk_ble_timer_en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_data_dump_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf.clk_data_dump_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_syscon_ll_data_dump_clock_is_enabled(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf.clk_data_dump_en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_etm_force_clock(modem_syscon_dev_t *hw)
|
||||
{
|
||||
@@ -210,18 +264,35 @@ static inline void modem_syscon_ll_enable_fe_txlogain_clock(modem_syscon_dev_t *
|
||||
hw->clk_conf1.clk_fe_txlogain_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_syscon_ll_fe_txlogain_clock_is_enabled(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf1.clk_fe_txlogain_en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_16m_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_fe_16m_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_syscon_ll_fe_16m_clock_is_enabled(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf1.clk_fe_16m_en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_32m_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_fe_32m_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_syscon_ll_fe_32m_clock_is_enabled(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf1.clk_fe_32m_en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_sdm_clock(modem_syscon_dev_t *hw, bool en)
|
||||
@@ -229,35 +300,71 @@ static inline void modem_syscon_ll_enable_fe_sdm_clock(modem_syscon_dev_t *hw, b
|
||||
hw->clk_conf1.clk_fe_sdm_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_syscon_ll_fe_sdm_clock_is_enabled(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf1.clk_fe_sdm_en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_adc_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_fe_adc_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_syscon_ll_fe_adc_clock_is_enabled(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf1.clk_fe_adc_en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_apb_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_fe_apb_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_syscon_ll_fe_apb_clock_is_enabled(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf1.clk_fe_apb_en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_bt_apb_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_bt_apb_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_syscon_ll_bt_apb_clock_is_enabled(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf1.clk_bt_apb_en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_bt_mac_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_syscon_ll_bt_mac_clock_is_enabled(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_bt_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
hw->clk_conf1.clk_bt_en = en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline bool modem_syscon_ll_bt_clock_is_enabled(modem_syscon_dev_t *hw)
|
||||
{
|
||||
return hw->clk_conf1.clk_bt_en;
|
||||
}
|
||||
|
||||
__attribute__((always_inline))
|
||||
static inline void modem_syscon_ll_enable_fe_force_clock(modem_syscon_dev_t *hw, bool en)
|
||||
{
|
||||
|
||||
@@ -19,6 +19,12 @@ void IRAM_ATTR modem_clock_hal_enable_modem_common_fe_clock(modem_clock_hal_cont
|
||||
modem_syscon_ll_enable_fe_32m_clock(hal->syscon_dev, enable);
|
||||
}
|
||||
|
||||
bool IRAM_ATTR modem_clock_hal_modem_common_fe_clock_is_enabled(modem_clock_hal_context_t *hal)
|
||||
{
|
||||
return modem_syscon_ll_fe_apb_clock_is_enabled(hal->syscon_dev) &&
|
||||
modem_syscon_ll_fe_32m_clock_is_enabled(hal->syscon_dev);
|
||||
}
|
||||
|
||||
void IRAM_ATTR modem_clock_hal_enable_modem_private_fe_clock(modem_clock_hal_context_t *hal, bool enable)
|
||||
{
|
||||
modem_lpcon_ll_enable_fe_mem_clock(hal->lpcon_dev, enable);
|
||||
@@ -28,6 +34,15 @@ void IRAM_ATTR modem_clock_hal_enable_modem_private_fe_clock(modem_clock_hal_con
|
||||
modem_syscon_ll_enable_fe_16m_clock(hal->syscon_dev, enable);
|
||||
}
|
||||
|
||||
bool IRAM_ATTR modem_clock_hal_modem_private_fe_clock_is_enabled(modem_clock_hal_context_t *hal)
|
||||
{
|
||||
return modem_lpcon_ll_fe_mem_clock_is_enabled(hal->lpcon_dev) &&
|
||||
modem_syscon_ll_fe_sdm_clock_is_enabled(hal->syscon_dev) &&
|
||||
modem_syscon_ll_fe_adc_clock_is_enabled(hal->syscon_dev) &&
|
||||
modem_syscon_ll_fe_txlogain_clock_is_enabled(hal->syscon_dev) &&
|
||||
modem_syscon_ll_fe_16m_clock_is_enabled(hal->syscon_dev);
|
||||
}
|
||||
|
||||
void modem_clock_hal_set_ble_rtc_timer_divisor_value(modem_clock_hal_context_t *hal, uint32_t divider)
|
||||
{
|
||||
lp_clkrst_ll_set_ble_rtc_timer_divisor_value(&LP_CLKRST, divider);
|
||||
|
||||
Reference in New Issue
Block a user