/* Initialized the controller for the ADuCM3029 external interrupts.  */
int32_t irq_ctrl_init(struct irq_ctrl_desc **desc, const struct irq_init_param *param)
/* Initialized the controller for the ADuCM3029 external interrupts.  */
int32_t irq_ctrl_init(struct irq_ctrl_desc **desc, const struct irq_init_param *param)
{
	struct aducm_irq_ctrl_desc *aducm_desc;
	if (!desc || !param || initialized)
		return FAILURE;
	*desc = (struct irq_ctrl_desc *)calloc(1, sizeof(**desc));
	if (!*desc)
		return FAILURE;
	aducm_desc = (struct aducm_irq_ctrl_desc *)
		     calloc(1, sizeof(*aducm_desc));
	if (!aducm_desc) {
		free(*desc);
		*desc = NULL;
		return FAILURE;
	}
	(*desc)->extra = aducm_desc;
	(*desc)->irq_ctrl_id = param->irq_ctrl_id;
	adi_xint_Init(aducm_desc->irq_memory, ADI_XINT_MEMORY_SIZE);
	initialized = 1;
	return SUCCESS;
}