|
55 | 55 |
|
56 | 56 | #if defined(CONFIG_ARCH_CHIP_ESP32S2)
|
57 | 57 | #include "soc/dedic_gpio_struct.h"
|
58 |
| -#include "hal/dedic_gpio_ll.h" |
59 | 58 | #endif
|
60 |
| -#include "soc/dedic_gpio_periph.h" |
| 59 | +#include "hal/dedic_gpio_ll.h" |
61 | 60 | #include "hal/dedic_gpio_cpu_ll.h"
|
| 61 | +#include "soc/dedic_gpio_periph.h" |
62 | 62 | #include "soc/gpio_sig_map.h"
|
63 | 63 | #include "periph_ctrl.h"
|
64 | 64 | #include "soc/soc_caps.h"
|
@@ -531,7 +531,12 @@ struct file *esp_dedic_gpio_new_bundle(
|
531 | 531 | #ifdef CONFIG_ARCH_CHIP_ESP32S2
|
532 | 532 | dedic_gpio_common[cpu].dev = &DEDIC_GPIO;
|
533 | 533 | #endif
|
534 |
| - periph_module_enable(dedic_gpio_periph_signals.module); |
| 534 | + PERIPH_RCC_ATOMIC() |
| 535 | + { |
| 536 | + dedic_gpio_ll_enable_bus_clock(true); |
| 537 | + dedic_gpio_ll_reset_register(); |
| 538 | + } |
| 539 | + |
535 | 540 | dedic_gpio_common[cpu].out_occupied_mask =
|
536 | 541 | UINT32_MAX & ~((1 << SOC_DEDIC_GPIO_OUT_CHANNELS_NUM) - 1);
|
537 | 542 | dedic_gpio_common[cpu].in_occupied_mask =
|
@@ -726,7 +731,11 @@ int esp_dedic_gpio_del_bundle(struct file *dev)
|
726 | 731 |
|
727 | 732 | if (dedic_gpio_common[cpu].refs == 0)
|
728 | 733 | {
|
729 |
| - periph_module_disable(dedic_gpio_periph_signals.module); |
| 734 | + PERIPH_RCC_ATOMIC() |
| 735 | + { |
| 736 | + dedic_gpio_ll_enable_bus_clock(false); |
| 737 | + } |
| 738 | + |
730 | 739 | #ifdef CONFIG_ESPRESSIF_DEDICATED_GPIO_IRQ
|
731 | 740 | dedic_gpio_ll_enable_interrupt(dedic_gpio_common[cpu].dev,
|
732 | 741 | ~0UL,
|
|
0 commit comments