Skip to content

Commit

Permalink
change(hal): remove useless code from periph_ll_wifi_bt_module_enable…
Browse files Browse the repository at this point in the history
…_clk
  • Loading branch information
muhaidong committed Nov 9, 2023
1 parent 1ddcca6 commit 91bd2c8
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 26 deletions.
4 changes: 2 additions & 2 deletions components/esp_hw_support/periph_ctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ IRAM_ATTR void wifi_bt_common_module_enable(void)
#else
portENTER_CRITICAL_SAFE(&periph_spinlock);
if (ref_counts[PERIPH_WIFI_BT_COMMON_MODULE] == 0) {
periph_ll_wifi_bt_module_enable_clk_clear_rst();
periph_ll_wifi_bt_module_enable_clk();
}
ref_counts[PERIPH_WIFI_BT_COMMON_MODULE]++;
portEXIT_CRITICAL_SAFE(&periph_spinlock);
Expand All @@ -107,7 +107,7 @@ IRAM_ATTR void wifi_bt_common_module_disable(void)
portENTER_CRITICAL_SAFE(&periph_spinlock);
ref_counts[PERIPH_WIFI_BT_COMMON_MODULE]--;
if (ref_counts[PERIPH_WIFI_BT_COMMON_MODULE] == 0) {
periph_ll_wifi_bt_module_disable_clk_set_rst();
periph_ll_wifi_bt_module_disable_clk();
}
portEXIT_CRITICAL_SAFE(&periph_spinlock);
#endif
Expand Down
6 changes: 2 additions & 4 deletions components/hal/esp32/include/hal/clk_gate_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,16 +230,14 @@ static inline void periph_ll_disable_clk_set_rst(periph_module_t periph)
DPORT_SET_PERI_REG_MASK(periph_ll_get_rst_en_reg(periph), periph_ll_get_rst_en_mask(periph, false));
}

static inline void IRAM_ATTR periph_ll_wifi_bt_module_enable_clk_clear_rst(void)
static inline void IRAM_ATTR periph_ll_wifi_bt_module_enable_clk(void)
{
DPORT_SET_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, DPORT_WIFI_CLK_WIFI_BT_COMMON_M);
DPORT_CLEAR_PERI_REG_MASK(DPORT_CORE_RST_EN_REG, 0);
}

static inline void IRAM_ATTR periph_ll_wifi_bt_module_disable_clk_set_rst(void)
static inline void IRAM_ATTR periph_ll_wifi_bt_module_disable_clk(void)
{
DPORT_CLEAR_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, DPORT_WIFI_CLK_WIFI_BT_COMMON_M);
DPORT_SET_PERI_REG_MASK(DPORT_CORE_RST_EN_REG, 0);
}

static inline void periph_ll_reset(periph_module_t periph)
Expand Down
6 changes: 2 additions & 4 deletions components/hal/esp32c2/include/hal/clk_gate_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,16 +180,14 @@ static inline void periph_ll_disable_clk_set_rst(periph_module_t periph)
DPORT_SET_PERI_REG_MASK(periph_ll_get_rst_en_reg(periph), periph_ll_get_rst_en_mask(periph, false));
}

static inline void IRAM_ATTR periph_ll_wifi_bt_module_enable_clk_clear_rst(void)
static inline void IRAM_ATTR periph_ll_wifi_bt_module_enable_clk(void)
{
DPORT_SET_PERI_REG_MASK(SYSTEM_WIFI_CLK_EN_REG, SYSTEM_WIFI_CLK_WIFI_BT_COMMON_M);
DPORT_CLEAR_PERI_REG_MASK(SYSTEM_CORE_RST_EN_REG, 0);
}

static inline void IRAM_ATTR periph_ll_wifi_bt_module_disable_clk_set_rst(void)
static inline void IRAM_ATTR periph_ll_wifi_bt_module_disable_clk(void)
{
DPORT_CLEAR_PERI_REG_MASK(SYSTEM_WIFI_CLK_EN_REG, SYSTEM_WIFI_CLK_WIFI_BT_COMMON_M);
DPORT_SET_PERI_REG_MASK(SYSTEM_CORE_RST_EN_REG, 0);
}

static inline void periph_ll_reset(periph_module_t periph)
Expand Down
6 changes: 2 additions & 4 deletions components/hal/esp32c3/include/hal/clk_gate_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,16 +229,14 @@ static inline void periph_ll_disable_clk_set_rst(periph_module_t periph)
DPORT_SET_PERI_REG_MASK(periph_ll_get_rst_en_reg(periph), periph_ll_get_rst_en_mask(periph, false));
}

static inline void IRAM_ATTR periph_ll_wifi_bt_module_enable_clk_clear_rst(void)
static inline void IRAM_ATTR periph_ll_wifi_bt_module_enable_clk(void)
{
DPORT_SET_PERI_REG_MASK(SYSTEM_WIFI_CLK_EN_REG, SYSTEM_WIFI_CLK_WIFI_BT_COMMON_M);
DPORT_CLEAR_PERI_REG_MASK(SYSTEM_CORE_RST_EN_REG, 0);
}

static inline void IRAM_ATTR periph_ll_wifi_bt_module_disable_clk_set_rst(void)
static inline void IRAM_ATTR periph_ll_wifi_bt_module_disable_clk(void)
{
DPORT_CLEAR_PERI_REG_MASK(SYSTEM_WIFI_CLK_EN_REG, SYSTEM_WIFI_CLK_WIFI_BT_COMMON_M);
DPORT_SET_PERI_REG_MASK(SYSTEM_CORE_RST_EN_REG, 0);
}

static inline void periph_ll_reset(periph_module_t periph)
Expand Down
6 changes: 2 additions & 4 deletions components/hal/esp32h2/include/hal/clk_gate_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,14 @@ static inline void periph_ll_disable_clk_set_rst(periph_module_t periph)
SET_PERI_REG_MASK(periph_ll_get_rst_en_reg(periph), periph_ll_get_rst_en_mask(periph, false));
}

static inline void periph_ll_wifi_bt_module_enable_clk_clear_rst(void)
static inline void periph_ll_wifi_bt_module_enable_clk(void)
{
// DPORT_SET_PERI_REG_MASK(SYSTEM_WIFI_CLK_EN_REG, SYSTEM_WIFI_CLK_WIFI_BT_COMMON_M);// ESP32H2-TODO: IDF-6400
// DPORT_CLEAR_PERI_REG_MASK(SYSTEM_CORE_RST_EN_REG, 0);
}

static inline void periph_ll_wifi_bt_module_disable_clk_set_rst(void)
static inline void periph_ll_wifi_bt_module_disable_clk(void)
{
// DPORT_CLEAR_PERI_REG_MASK(SYSTEM_WIFI_CLK_EN_REG, SYSTEM_WIFI_CLK_WIFI_BT_COMMON_M);// ESP32H2-TODO: IDF-6400
// DPORT_SET_PERI_REG_MASK(SYSTEM_CORE_RST_EN_REG, 0);
}

static inline void periph_ll_reset(periph_module_t periph)
Expand Down
6 changes: 2 additions & 4 deletions components/hal/esp32s2/include/hal/clk_gate_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,14 @@ static inline void periph_ll_disable_clk_set_rst(periph_module_t periph)
DPORT_SET_PERI_REG_MASK(periph_ll_get_rst_en_reg(periph), periph_ll_get_rst_en_mask(periph, false));
}

static inline void IRAM_ATTR periph_ll_wifi_bt_module_enable_clk_clear_rst(void)
static inline void IRAM_ATTR periph_ll_wifi_bt_module_enable_clk(void)
{
DPORT_SET_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, DPORT_WIFI_CLK_WIFI_BT_COMMON_M);
DPORT_CLEAR_PERI_REG_MASK(DPORT_CORE_RST_EN_REG, 0);
}

static inline void IRAM_ATTR periph_ll_wifi_bt_module_disable_clk_set_rst(void)
static inline void IRAM_ATTR periph_ll_wifi_bt_module_disable_clk(void)
{
DPORT_CLEAR_PERI_REG_MASK(DPORT_WIFI_CLK_EN_REG, DPORT_WIFI_CLK_WIFI_BT_COMMON_M);
DPORT_SET_PERI_REG_MASK(DPORT_CORE_RST_EN_REG, 0);
}

static inline void periph_ll_reset(periph_module_t periph)
Expand Down
6 changes: 2 additions & 4 deletions components/hal/esp32s3/include/hal/clk_gate_ll.h
Original file line number Diff line number Diff line change
Expand Up @@ -264,16 +264,14 @@ static inline void periph_ll_disable_clk_set_rst(periph_module_t periph)
DPORT_SET_PERI_REG_MASK(periph_ll_get_rst_en_reg(periph), periph_ll_get_rst_en_mask(periph, false));
}

static inline void IRAM_ATTR periph_ll_wifi_bt_module_enable_clk_clear_rst(void)
static inline void IRAM_ATTR periph_ll_wifi_bt_module_enable_clk(void)
{
DPORT_SET_PERI_REG_MASK(SYSTEM_WIFI_CLK_EN_REG, SYSTEM_WIFI_CLK_WIFI_BT_COMMON_M);
DPORT_CLEAR_PERI_REG_MASK(SYSTEM_CORE_RST_EN_REG, 0);
}

static inline void IRAM_ATTR periph_ll_wifi_bt_module_disable_clk_set_rst(void)
static inline void IRAM_ATTR periph_ll_wifi_bt_module_disable_clk(void)
{
DPORT_CLEAR_PERI_REG_MASK(SYSTEM_WIFI_CLK_EN_REG, SYSTEM_WIFI_CLK_WIFI_BT_COMMON_M);
DPORT_SET_PERI_REG_MASK(SYSTEM_CORE_RST_EN_REG, 0);
}

static inline void periph_ll_reset(periph_module_t periph)
Expand Down

0 comments on commit 91bd2c8

Please sign in to comment.