~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/arm/mach-ixp4xx/gtwx5715-pci.c

Version: ~ [ linux-5.1-rc5 ] ~ [ linux-5.0.7 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.34 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.111 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.168 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.178 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.138 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.65 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * arch/arm/mach-ixp4xx/gtwx5715-pci.c
  3  *
  4  * Gemtek GTWX5715 (Linksys WRV54G) board setup
  5  *
  6  * Copyright (C) 2004 George T. Joseph
  7  * Derived from Coyote
  8  *
  9  * This program is free software; you can redistribute it and/or
 10  * modify it under the terms of the GNU General Public License
 11  * as published by the Free Software Foundation; either version 2
 12  * of the License, or (at your option) any later version.
 13  *
 14  * This program is distributed in the hope that it will be useful,
 15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 17  * GNU General Public License for more details.
 18  *
 19  * You should have received a copy of the GNU General Public License
 20  * along with this program; if not, write to the Free Software
 21  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 22  *
 23  */
 24 
 25 #include <linux/pci.h>
 26 #include <linux/init.h>
 27 #include <linux/delay.h>
 28 #include <linux/irq.h>
 29 #include <asm/mach-types.h>
 30 #include <mach/hardware.h>
 31 #include <asm/mach/pci.h>
 32 
 33 #define SLOT0_DEVID     0
 34 #define SLOT1_DEVID     1
 35 #define INTA            10 /* slot 1 has INTA and INTB crossed */
 36 #define INTB            11
 37 
 38 /*
 39  * Slot 0 isn't actually populated with a card connector but
 40  * we initialize it anyway in case a future version has the
 41  * slot populated or someone with good soldering skills has
 42  * some free time.
 43  */
 44 void __init gtwx5715_pci_preinit(void)
 45 {
 46         irq_set_irq_type(IXP4XX_GPIO_IRQ(INTA), IRQ_TYPE_LEVEL_LOW);
 47         irq_set_irq_type(IXP4XX_GPIO_IRQ(INTB), IRQ_TYPE_LEVEL_LOW);
 48         ixp4xx_pci_preinit();
 49 }
 50 
 51 
 52 static int __init gtwx5715_map_irq(const struct pci_dev *dev, u8 slot, u8 pin)
 53 {
 54         int rc = -1;
 55 
 56         if ((slot == SLOT0_DEVID && pin == 1) ||
 57             (slot == SLOT1_DEVID && pin == 2))
 58                 rc = IXP4XX_GPIO_IRQ(INTA);
 59         else if ((slot == SLOT0_DEVID && pin == 2) ||
 60                  (slot == SLOT1_DEVID && pin == 1))
 61                 rc = IXP4XX_GPIO_IRQ(INTB);
 62 
 63         printk(KERN_INFO "%s: Mapped slot %d pin %d to IRQ %d\n",
 64                __func__, slot, pin, rc);
 65         return rc;
 66 }
 67 
 68 struct hw_pci gtwx5715_pci __initdata = {
 69         .nr_controllers = 1,
 70         .ops            = &ixp4xx_ops,
 71         .preinit =        gtwx5715_pci_preinit,
 72         .setup =          ixp4xx_setup,
 73         .map_irq =        gtwx5715_map_irq,
 74 };
 75 
 76 int __init gtwx5715_pci_init(void)
 77 {
 78         if (machine_is_gtwx5715())
 79                 pci_common_init(&gtwx5715_pci);
 80 
 81         return 0;
 82 }
 83 
 84 subsys_initcall(gtwx5715_pci_init);
 85 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp