Skip to content

Commit d0e24e4

Browse files
committed
refactor(hw_support): remove unused periph_module_t members
1 parent 068c8ab commit d0e24e4

File tree

37 files changed

+124
-1341
lines changed

37 files changed

+124
-1341
lines changed

components/esp_driver_spi/src/gpspi/spi_common.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ int spicommon_irqdma_source_for_host(spi_host_device_t host)
150150
#if !SOC_GDMA_SUPPORTED
151151

152152
#if SPI_LL_DMA_SHARED
153-
static inline periph_module_t get_dma_periph(int dma_chan)
153+
static inline shared_periph_module_t get_dma_periph(int dma_chan)
154154
{
155155
assert(dma_chan >= 1 && dma_chan <= SOC_SPI_DMA_CHAN_NUM);
156156
if (dma_chan == 1) {

components/esp_hal_timg/include/soc/timer_periph.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extern "C" {
2828

2929
typedef struct {
3030
const char *module_name; // Module name
31-
const periph_module_t parent_module; // GPTimer is a submodule under the timer group
31+
const shared_periph_module_t parent_module; // GPTimer is a submodule under the timer group
3232
const int irq_id; // interrupt source ID
3333
} soc_timg_gptimer_signal_desc_t;
3434

components/esp_hw_support/include/esp_private/esp_modem_clock.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -43,7 +43,7 @@ extern "C" {
4343
*
4444
* @param module modem module
4545
*/
46-
void modem_clock_module_enable(periph_module_t module);
46+
void modem_clock_module_enable(shared_periph_module_t module);
4747

4848
/**
4949
* @brief Disable the clock of modem module
@@ -60,15 +60,15 @@ void modem_clock_module_enable(periph_module_t module);
6060
*
6161
* @param module modem module
6262
*/
63-
void modem_clock_module_disable(periph_module_t module);
63+
void modem_clock_module_disable(shared_periph_module_t module);
6464

6565
/**
6666
* @brief Reset the mac of modem module
6767
*
6868
* @param module modem module, must be one of
6969
* PERIPH_WIFI_MODULE / PERIPH_BT_MODULE /PERIPH_IEEE802154_MODULE
7070
*/
71-
void modem_clock_module_mac_reset(periph_module_t module);
71+
void modem_clock_module_mac_reset(shared_periph_module_t module);
7272

7373
#if SOC_BLE_USE_WIFI_PWR_CLK_WORKAROUND
7474
/**
@@ -103,13 +103,13 @@ esp_err_t modem_clock_domain_clk_gate_disable(modem_clock_domain_t domain, pmu_h
103103
* @param src lowpower clock source
104104
* @param divider divider value to lowpower clock source
105105
*/
106-
void modem_clock_select_lp_clock_source(periph_module_t module, modem_clock_lpclk_src_t src, uint32_t divider);
106+
void modem_clock_select_lp_clock_source(shared_periph_module_t module, modem_clock_lpclk_src_t src, uint32_t divider);
107107

108108
/**
109109
* @brief Disable lowpower clock source selection
110110
* @param module modem module
111111
*/
112-
void modem_clock_deselect_lp_clock_source(periph_module_t module);
112+
void modem_clock_deselect_lp_clock_source(shared_periph_module_t module);
113113

114114
/**
115115
* @brief Disable all modem module's lowpower clock source selection

components/esp_hw_support/include/esp_private/periph_ctrl.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2015-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -54,10 +54,10 @@ extern "C" {
5454

5555
/** @cond */
5656
// The following functions are not intended to be used directly by the developers
57-
uint8_t periph_rcc_acquire_enter(periph_module_t periph);
58-
void periph_rcc_acquire_exit(periph_module_t periph, uint8_t ref_count);
59-
uint8_t periph_rcc_release_enter(periph_module_t periph);
60-
void periph_rcc_release_exit(periph_module_t periph, uint8_t ref_count);
57+
uint8_t periph_rcc_acquire_enter(shared_periph_module_t periph);
58+
void periph_rcc_acquire_exit(shared_periph_module_t periph, uint8_t ref_count);
59+
uint8_t periph_rcc_release_enter(shared_periph_module_t periph);
60+
void periph_rcc_release_exit(shared_periph_module_t periph, uint8_t ref_count);
6161
void periph_rcc_enter(void);
6262
void periph_rcc_exit(void);
6363
/** @endcond */
@@ -97,7 +97,7 @@ void periph_rcc_exit(void);
9797
* in order to put the peripheral into disabled state.
9898
*/
9999
__PERIPH_CTRL_DEPRECATE_ATTR
100-
void periph_module_enable(periph_module_t periph);
100+
void periph_module_enable(shared_periph_module_t periph);
101101

102102
/**
103103
* @brief Disable peripheral module by gating the clock and asserting the reset signal.
@@ -109,7 +109,7 @@ void periph_module_enable(periph_module_t periph);
109109
* in order to put the peripheral into disabled state.
110110
*/
111111
__PERIPH_CTRL_DEPRECATE_ATTR
112-
void periph_module_disable(periph_module_t periph);
112+
void periph_module_disable(shared_periph_module_t periph);
113113

114114
/**
115115
* @brief Reset peripheral module by asserting and de-asserting the reset signal.
@@ -119,7 +119,7 @@ void periph_module_disable(periph_module_t periph);
119119
* @note Calling this function does not enable or disable the clock for the module.
120120
*/
121121
__PERIPH_CTRL_DEPRECATE_ATTR
122-
void periph_module_reset(periph_module_t periph);
122+
void periph_module_reset(shared_periph_module_t periph);
123123

124124
/**
125125
* @brief Enable Wi-Fi and BT common module

components/esp_hw_support/modem_clock.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ static void IRAM_ATTR modem_clock_device_disable(modem_clock_context_t *ctx, uin
266266
assert(refs >= 0);
267267
}
268268

269-
void IRAM_ATTR modem_clock_module_mac_reset(periph_module_t module)
269+
void IRAM_ATTR modem_clock_module_mac_reset(shared_periph_module_t module)
270270
{
271271
__attribute__((unused)) modem_clock_context_t *ctx = MODEM_CLOCK_instance();
272272
esp_os_enter_critical_safe(&ctx->lock);
@@ -312,7 +312,7 @@ void IRAM_ATTR modem_clock_module_mac_reset(periph_module_t module)
312312
#define PHY_CALIBRATION_CLOCK_DEPS (BIT(MODEM_CLOCK_WIFI_APB) | BIT(MODEM_CLOCK_WIFI_BB_44M))
313313
#endif
314314

315-
static IRAM_ATTR uint32_t modem_clock_get_module_deps(periph_module_t module)
315+
static IRAM_ATTR uint32_t modem_clock_get_module_deps(shared_periph_module_t module)
316316
{
317317
uint32_t deps = 0;
318318
switch (module) {
@@ -376,7 +376,7 @@ static IRAM_ATTR void modem_clock_module_icg_map_init_all(void)
376376
}
377377
#endif
378378

379-
void IRAM_ATTR modem_clock_module_enable(periph_module_t module)
379+
void IRAM_ATTR modem_clock_module_enable(shared_periph_module_t module)
380380
{
381381
assert(IS_MODEM_MODULE(module));
382382
#if SOC_PM_SUPPORT_PMU_MODEM_STATE
@@ -386,7 +386,7 @@ void IRAM_ATTR modem_clock_module_enable(periph_module_t module)
386386
modem_clock_device_enable(MODEM_CLOCK_instance(), deps);
387387
}
388388

389-
void IRAM_ATTR modem_clock_module_disable(periph_module_t module)
389+
void IRAM_ATTR modem_clock_module_disable(shared_periph_module_t module)
390390
{
391391
assert(IS_MODEM_MODULE(module));
392392
uint32_t deps = modem_clock_get_module_deps(module);
@@ -404,7 +404,7 @@ void modem_clock_deselect_all_module_lp_clock_source(void)
404404
modem_clock_hal_deselect_all_coex_lpclk_source(MODEM_CLOCK_instance()->hal);
405405
}
406406

407-
void modem_clock_select_lp_clock_source(periph_module_t module, modem_clock_lpclk_src_t src, uint32_t divider)
407+
void modem_clock_select_lp_clock_source(shared_periph_module_t module, modem_clock_lpclk_src_t src, uint32_t divider)
408408
{
409409
assert(IS_MODEM_MODULE(module));
410410
esp_os_enter_critical_safe(&MODEM_CLOCK_instance()->lock);
@@ -497,7 +497,7 @@ void modem_clock_select_lp_clock_source(periph_module_t module, modem_clock_lpcl
497497
#endif
498498
}
499499

500-
void modem_clock_deselect_lp_clock_source(periph_module_t module)
500+
void modem_clock_deselect_lp_clock_source(shared_periph_module_t module)
501501
{
502502
assert(IS_MODEM_MODULE(module));
503503
esp_os_enter_critical_safe(&MODEM_CLOCK_instance()->lock);

components/esp_hw_support/periph_ctrl.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,31 @@ void periph_rcc_exit(void)
3232
esp_os_exit_critical_safe(&periph_spinlock);
3333
}
3434

35-
uint8_t periph_rcc_acquire_enter(periph_module_t periph)
35+
uint8_t periph_rcc_acquire_enter(shared_periph_module_t periph)
3636
{
3737
periph_rcc_enter();
3838
return ref_counts[periph];
3939
}
4040

41-
void periph_rcc_acquire_exit(periph_module_t periph, uint8_t ref_count)
41+
void periph_rcc_acquire_exit(shared_periph_module_t periph, uint8_t ref_count)
4242
{
4343
ref_counts[periph] = ++ref_count;
4444
periph_rcc_exit();
4545
}
4646

47-
uint8_t periph_rcc_release_enter(periph_module_t periph)
47+
uint8_t periph_rcc_release_enter(shared_periph_module_t periph)
4848
{
4949
periph_rcc_enter();
5050
return ref_counts[periph] - 1;
5151
}
5252

53-
void periph_rcc_release_exit(periph_module_t periph, uint8_t ref_count)
53+
void periph_rcc_release_exit(shared_periph_module_t periph, uint8_t ref_count)
5454
{
5555
ref_counts[periph] = ref_count;
5656
periph_rcc_exit();
5757
}
5858

59-
void periph_module_enable(periph_module_t periph)
59+
void periph_module_enable(shared_periph_module_t periph)
6060
{
6161
#ifdef __PERIPH_CTRL_ALLOW_LEGACY_API
6262
assert(periph < PERIPH_MODULE_MAX);
@@ -69,7 +69,7 @@ void periph_module_enable(periph_module_t periph)
6969
#endif
7070
}
7171

72-
void periph_module_disable(periph_module_t periph)
72+
void periph_module_disable(shared_periph_module_t periph)
7373
{
7474
#ifdef __PERIPH_CTRL_ALLOW_LEGACY_API
7575
assert(periph < PERIPH_MODULE_MAX);
@@ -82,7 +82,7 @@ void periph_module_disable(periph_module_t periph)
8282
#endif
8383
}
8484

85-
void periph_module_reset(periph_module_t periph)
85+
void periph_module_reset(shared_periph_module_t periph)
8686
{
8787
#ifdef __PERIPH_CTRL_ALLOW_LEGACY_API
8888
assert(periph < PERIPH_MODULE_MAX);

0 commit comments

Comments
 (0)