Path: blob/master/arch/arm/mach-ixp4xx/gateway7001-pci.c
10817 views
/*1* arch/arch/mach-ixp4xx/gateway7001-pci.c2*3* PCI setup routines for Gateway 70014*5* Copyright (C) 2007 Imre Kaloz <[email protected]>6*7* based on coyote-pci.c:8* Copyright (C) 2002 Jungo Software Technologies.9* Copyright (C) 2003 MontaVista Softwrae, Inc.10*11* Maintainer: Imre Kaloz <[email protected]>12*13* This program is free software; you can redistribute it and/or modify14* it under the terms of the GNU General Public License version 2 as15* published by the Free Software Foundation.16*17*/1819#include <linux/kernel.h>20#include <linux/pci.h>21#include <linux/init.h>22#include <linux/irq.h>2324#include <asm/mach-types.h>25#include <mach/hardware.h>2627#include <asm/mach/pci.h>2829void __init gateway7001_pci_preinit(void)30{31irq_set_irq_type(IRQ_IXP4XX_GPIO10, IRQ_TYPE_LEVEL_LOW);32irq_set_irq_type(IRQ_IXP4XX_GPIO11, IRQ_TYPE_LEVEL_LOW);3334ixp4xx_pci_preinit();35}3637static int __init gateway7001_map_irq(struct pci_dev *dev, u8 slot, u8 pin)38{39if (slot == 1)40return IRQ_IXP4XX_GPIO11;41else if (slot == 2)42return IRQ_IXP4XX_GPIO10;43else return -1;44}4546struct hw_pci gateway7001_pci __initdata = {47.nr_controllers = 1,48.preinit = gateway7001_pci_preinit,49.swizzle = pci_std_swizzle,50.setup = ixp4xx_setup,51.scan = ixp4xx_scan_bus,52.map_irq = gateway7001_map_irq,53};5455int __init gateway7001_pci_init(void)56{57if (machine_is_gateway7001())58pci_common_init(&gateway7001_pci);59return 0;60}6162subsys_initcall(gateway7001_pci_init);636465