drivers: interrupt_controller: ra_icu: Adding `disconnect_dynamic`

Adding `ra_icu_irq_disconnect_dynamic()` corresponds with
`ra_icu_irq_connect_dynamic()`.

Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@fujitsu.com>
This commit is contained in:
TOKITA Hiroshi 2023-11-23 23:10:13 +09:00 committed by Fabio Baltieri
parent 75ac40e6d8
commit bccd281b3d
2 changed files with 22 additions and 0 deletions

View File

@ -104,5 +104,23 @@ int ra_icu_irq_connect_dynamic(unsigned int irq, unsigned int priority,
return irqn;
}
int ra_icu_irq_disconnect_dynamic(unsigned int irq, unsigned int priority,
void (*routine)(const void *parameter), const void *parameter,
uint32_t flags)
{
int irqn = irq;
if (irq == RA_ICU_IRQ_UNSPECIFIED) {
return -EINVAL;
}
irq_disable(irqn);
sys_write32(0, IELSRn_REG(irqn));
z_isr_install(irqn, z_irq_spurious, NULL);
z_arm_irq_priority_set(irqn, 0, 0);
return 0;
}
DEVICE_DT_INST_DEFINE(0, NULL, NULL, NULL, NULL, PRE_KERNEL_1, CONFIG_INTC_INIT_PRIORITY,
NULL);

View File

@ -35,4 +35,8 @@ extern int ra_icu_irq_connect_dynamic(unsigned int irq, unsigned int priority,
void (*routine)(const void *parameter), const void *parameter,
uint32_t flags);
extern int ra_icu_irq_disconnect_dynamic(unsigned int irq, unsigned int priority,
void (*routine)(const void *parameter),
const void *parameter, uint32_t flags);
#endif /* ZEPHYR_DRIVERS_INTERRUPT_CONTROLLER_INTC_RA_ICU_H_ */