Skip to content

Commit 735e16f

Browse files
eren-terziogluxiaoxiang781216
authored andcommitted
arch/xtensa: Fix dedicated GPIO build error
Fix dedicated GPIO build error for esp32[-s2|-s3] Signed-off-by: Eren Terzioglu <[email protected]>
1 parent 06b37fe commit 735e16f

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

arch/xtensa/src/common/espressif/esp_dedic_gpio.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,10 @@
5555

5656
#if defined(CONFIG_ARCH_CHIP_ESP32S2)
5757
#include "soc/dedic_gpio_struct.h"
58-
#include "hal/dedic_gpio_ll.h"
5958
#endif
60-
#include "soc/dedic_gpio_periph.h"
59+
#include "hal/dedic_gpio_ll.h"
6160
#include "hal/dedic_gpio_cpu_ll.h"
61+
#include "soc/dedic_gpio_periph.h"
6262
#include "soc/gpio_sig_map.h"
6363
#include "periph_ctrl.h"
6464
#include "soc/soc_caps.h"
@@ -531,7 +531,12 @@ struct file *esp_dedic_gpio_new_bundle(
531531
#ifdef CONFIG_ARCH_CHIP_ESP32S2
532532
dedic_gpio_common[cpu].dev = &DEDIC_GPIO;
533533
#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+
535540
dedic_gpio_common[cpu].out_occupied_mask =
536541
UINT32_MAX & ~((1 << SOC_DEDIC_GPIO_OUT_CHANNELS_NUM) - 1);
537542
dedic_gpio_common[cpu].in_occupied_mask =
@@ -726,7 +731,11 @@ int esp_dedic_gpio_del_bundle(struct file *dev)
726731

727732
if (dedic_gpio_common[cpu].refs == 0)
728733
{
729-
periph_module_disable(dedic_gpio_periph_signals.module);
734+
PERIPH_RCC_ATOMIC()
735+
{
736+
dedic_gpio_ll_enable_bus_clock(false);
737+
}
738+
730739
#ifdef CONFIG_ESPRESSIF_DEDICATED_GPIO_IRQ
731740
dedic_gpio_ll_enable_interrupt(dedic_gpio_common[cpu].dev,
732741
~0UL,

0 commit comments

Comments
 (0)