Skip to content

Commit 7db5fd6

Browse files
TE-N-ShengjiuWangKAGA-KOKO
authored andcommitted
irqchip/imx-irqsteer: Support up to 960 input interrupts
The irqsteer IP routes groups of input interrupts to a dedicated system interrupt per group. Each group handles 64 input interrupts. The current driver is limited to 8 groups, i.e. 512 input interrupts, which is sufficient for the existing i.MX SoCs. The upcoming i.MX94 family extends the irqsteer IP to 15 groups, i.e. 960 interrupts. Extending the group limit to 15 enables this, but the new SoCs are not guaranteed to utilize all 15 groups. Unused groups have no mapping for the underlying output interrupt, which makes the probe function fail as it expects a valid mapping for each group output. Remove this limitation and stop the mapping loop, when no valid mapping is detected. [ tglx: Massage change log ] Signed-off-by: Shengjiu Wang <[email protected]> Signed-off-by: Jacky Bai <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Ye Li <[email protected]> Reviewed-by: Peng Fan <[email protected]> Reviewed-by: Frank Li <[email protected]> Link: https://lore.kernel.org/all/[email protected]
1 parent 922ac17 commit 7db5fd6

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

drivers/irqchip/irq-imx-irqsteer.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#define CHAN_MINTDIS(t) (CTRL_STRIDE_OFF(t, 3) + 0x4)
2525
#define CHAN_MASTRSTAT(t) (CTRL_STRIDE_OFF(t, 3) + 0x8)
2626

27-
#define CHAN_MAX_OUTPUT_INT 0x8
27+
#define CHAN_MAX_OUTPUT_INT 0xF
2828

2929
struct irqsteer_data {
3030
void __iomem *regs;
@@ -228,10 +228,8 @@ static int imx_irqsteer_probe(struct platform_device *pdev)
228228

229229
for (i = 0; i < data->irq_count; i++) {
230230
data->irq[i] = irq_of_parse_and_map(np, i);
231-
if (!data->irq[i]) {
232-
ret = -EINVAL;
233-
goto out;
234-
}
231+
if (!data->irq[i])
232+
break;
235233

236234
irq_set_chained_handler_and_data(data->irq[i],
237235
imx_irqsteer_irq_handler,
@@ -254,9 +252,13 @@ static void imx_irqsteer_remove(struct platform_device *pdev)
254252
struct irqsteer_data *irqsteer_data = platform_get_drvdata(pdev);
255253
int i;
256254

257-
for (i = 0; i < irqsteer_data->irq_count; i++)
255+
for (i = 0; i < irqsteer_data->irq_count; i++) {
256+
if (!irqsteer_data->irq[i])
257+
break;
258+
258259
irq_set_chained_handler_and_data(irqsteer_data->irq[i],
259260
NULL, NULL);
261+
}
260262

261263
irq_domain_remove(irqsteer_data->domain);
262264

0 commit comments

Comments
 (0)