Commit de575de8 authored by Marc Zyngier's avatar Marc Zyngier Committed by Thomas Gleixner
Browse files

irqchip/apple-aic: Add FW info retrieval support



Plug the new .get_fwspec_info() callback into the Apple AIC driver, using
some of the existing FIQ affinity handling infrastructure.

Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarWill Deacon <will@kernel.org>
Acked-by: default avatarSven Peter <sven@kernel.org>
Link: https://patch.msgid.link/20251020122944.3074811-7-maz@kernel.org
parent 68905ea6
Loading
Loading
Loading
Loading
+31 −3
Original line number Diff line number Diff line
@@ -651,6 +651,33 @@ static int aic_irq_domain_map(struct irq_domain *id, unsigned int irq,
	return 0;
}

static int aic_irq_get_fwspec_info(struct irq_fwspec *fwspec, struct irq_fwspec_info *info)
{
	const struct cpumask *mask;
	u32 intid;

	info->flags = 0;
	info->affinity = NULL;

	if (fwspec->param[0] != AIC_FIQ)
		return 0;

	if (fwspec->param_count == 3)
		intid = fwspec->param[1];
	else
		intid = fwspec->param[2];

	if (aic_irqc->fiq_aff[intid])
		mask = &aic_irqc->fiq_aff[intid]->aff;
	else
		mask = cpu_possible_mask;

	info->affinity = mask;
	info->flags = IRQ_FWSPEC_INFO_AFFINITY_VALID;

	return 0;
}

static int aic_irq_domain_translate(struct irq_domain *id,
				    struct irq_fwspec *fwspec,
				    unsigned long *hwirq,
@@ -753,6 +780,7 @@ static const struct irq_domain_ops aic_irq_domain_ops = {
	.translate		= aic_irq_domain_translate,
	.alloc			= aic_irq_domain_alloc,
	.free			= aic_irq_domain_free,
	.get_fwspec_info	= aic_irq_get_fwspec_info,
};

/*