1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * arch/arm/mach-ixp4xx/gtwx5715-pci.c
5 * Gemtek GTWX5715 (Linksys WRV54G) board setup
7 * Copyright (C) 2004 George T. Joseph
11 #include <linux/pci.h>
12 #include <linux/init.h>
13 #include <linux/delay.h>
14 #include <linux/irq.h>
15 #include <asm/mach-types.h>
16 #include <mach/hardware.h>
17 #include <asm/mach/pci.h>
23 #define INTA 10 /* slot 1 has INTA and INTB crossed */
27 * Slot 0 isn't actually populated with a card connector but
28 * we initialize it anyway in case a future version has the
29 * slot populated or someone with good soldering skills has
32 void __init
gtwx5715_pci_preinit(void)
34 irq_set_irq_type(IXP4XX_GPIO_IRQ(INTA
), IRQ_TYPE_LEVEL_LOW
);
35 irq_set_irq_type(IXP4XX_GPIO_IRQ(INTB
), IRQ_TYPE_LEVEL_LOW
);
40 static int __init
gtwx5715_map_irq(const struct pci_dev
*dev
, u8 slot
, u8 pin
)
44 if ((slot
== SLOT0_DEVID
&& pin
== 1) ||
45 (slot
== SLOT1_DEVID
&& pin
== 2))
46 rc
= IXP4XX_GPIO_IRQ(INTA
);
47 else if ((slot
== SLOT0_DEVID
&& pin
== 2) ||
48 (slot
== SLOT1_DEVID
&& pin
== 1))
49 rc
= IXP4XX_GPIO_IRQ(INTB
);
51 printk(KERN_INFO
"%s: Mapped slot %d pin %d to IRQ %d\n",
52 __func__
, slot
, pin
, rc
);
56 struct hw_pci gtwx5715_pci __initdata
= {
59 .preinit
= gtwx5715_pci_preinit
,
60 .setup
= ixp4xx_setup
,
61 .map_irq
= gtwx5715_map_irq
,
64 int __init
gtwx5715_pci_init(void)
66 if (machine_is_gtwx5715())
67 pci_common_init(>wx5715_pci
);
72 subsys_initcall(gtwx5715_pci_init
);