Lines Matching refs:source
76 static uint32_t esp_intr_find_irq_for_source(uint32_t source) in esp_intr_find_irq_for_source() argument
81 uint32_t irq = (source / ESP32C3_INTC_SRCS_PER_IRQ); in esp_intr_find_irq_for_source()
84 INTC_LOG("Clamping the source: %d no more IRQs available", source); in esp_intr_find_irq_for_source()
90 INTC_LOG("Found IRQ: %d for source: %d", irq, source); in esp_intr_find_irq_for_source()
97 static uint32_t esp_intr_find_irq_for_source(uint32_t source) in esp_intr_find_irq_for_source() argument
111 if (esp_intr_irq_alloc[i][j] == source) { in esp_intr_find_irq_for_source()
123 *irq_ptr = (uint8_t)source; in esp_intr_find_irq_for_source()
130 INTC_LOG("Found IRQ: %d for source: %d", irq, source); in esp_intr_find_irq_for_source()
166 int esp_intr_alloc(int source, in esp_intr_alloc() argument
179 if (source < 0 || source >= ETS_MAX_INTR_SOURCE) { in esp_intr_alloc()
185 irq_connect_dynamic(source, in esp_intr_alloc()
191 if (source < 32) { in esp_intr_alloc()
192 esp_intr_enabled_mask[0] |= (1 << source); in esp_intr_alloc()
193 } else if (source < 64) { in esp_intr_alloc()
194 esp_intr_enabled_mask[1] |= (1 << (source - 32)); in esp_intr_alloc()
195 } else if (source < 96) { in esp_intr_alloc()
196 esp_intr_enabled_mask[2] |= (1 << (source - 64)); in esp_intr_alloc()
203 int ret = esp_intr_enable(source); in esp_intr_alloc()
208 int esp_intr_disable(int source) in esp_intr_disable() argument
210 if (source < 0 || source >= ETS_MAX_INTR_SOURCE) { in esp_intr_disable()
217 source, in esp_intr_disable()
223 if (esp_intr_irq_alloc[i][j] == source) { in esp_intr_disable()
232 if (source < 32) { in esp_intr_disable()
233 esp_intr_enabled_mask[0] &= ~(1 << source); in esp_intr_disable()
234 } else if (source < 64) { in esp_intr_disable()
235 esp_intr_enabled_mask[1] &= ~(1 << (source - 32)); in esp_intr_disable()
236 } else if (source < 96) { in esp_intr_disable()
237 esp_intr_enabled_mask[2] &= ~(1 << (source - 64)); in esp_intr_disable()
248 int esp_intr_enable(int source) in esp_intr_enable() argument
250 if (source < 0 || source >= ETS_MAX_INTR_SOURCE) { in esp_intr_enable()
255 uint32_t irq = esp_intr_find_irq_for_source(source); in esp_intr_enable()
264 esp_rom_intr_matrix_set(0, source, irq); in esp_intr_enable()
266 if (source < 32) { in esp_intr_enable()
267 esp_intr_enabled_mask[0] |= (1 << source); in esp_intr_enable()
268 } else if (source < 64) { in esp_intr_enable()
269 esp_intr_enabled_mask[1] |= (1 << (source - 32)); in esp_intr_enable()
270 } else if (source < 96) { in esp_intr_enable()
271 esp_intr_enabled_mask[2] |= (1 << (source - 64)); in esp_intr_enable()