[kernel] add a polled GPIO buttons input driver
[openwrt.git] / target / linux / generic-2.6 / files / drivers / ssb / scan.c
index b5d909c..63ee5cf 100644 (file)
 #include <linux/ssb/ssb.h>
 #include <linux/ssb/ssb_regs.h>
 #include <linux/pci.h>
 #include <linux/ssb/ssb.h>
 #include <linux/ssb/ssb_regs.h>
 #include <linux/pci.h>
-#include <asm/io.h>
+#include <linux/io.h>
 
 
-#ifdef CONFIG_SSB_PCMCIAHOST
-# include <pcmcia/cs_types.h>
-# include <pcmcia/cs.h>
-# include <pcmcia/cistpl.h>
-# include <pcmcia/ds.h>
-#endif
+#include <pcmcia/cs_types.h>
+#include <pcmcia/cs.h>
+#include <pcmcia/cistpl.h>
+#include <pcmcia/ds.h>
 
 #include "ssb_private.h"
 
 
 
 #include "ssb_private.h"
 
 
-const char * ssb_core_name(u16 coreid)
+const char *ssb_core_name(u16 coreid)
 {
        switch (coreid) {
        case SSB_DEV_CHIPCOMMON:
 {
        switch (coreid) {
        case SSB_DEV_CHIPCOMMON:
@@ -205,7 +203,7 @@ void ssb_iounmap(struct ssb_bus *bus)
 #ifdef CONFIG_SSB_PCIHOST
                pci_iounmap(bus->host_pci, bus->mmio);
 #else
 #ifdef CONFIG_SSB_PCIHOST
                pci_iounmap(bus->host_pci, bus->mmio);
 #else
-               assert(0); /* Can't reach this code. */
+               SSB_BUG_ON(1); /* Can't reach this code. */
 #endif
                break;
        }
 #endif
                break;
        }
@@ -213,8 +211,8 @@ void ssb_iounmap(struct ssb_bus *bus)
        bus->mapped_device = NULL;
 }
 
        bus->mapped_device = NULL;
 }
 
-static void __iomem * ssb_ioremap(struct ssb_bus *bus,
-                                 unsigned long baseaddr)
+static void __iomem *ssb_ioremap(struct ssb_bus *bus,
+                                unsigned long baseaddr)
 {
        void __iomem *mmio = NULL;
 
 {
        void __iomem *mmio = NULL;
 
@@ -229,7 +227,7 @@ static void __iomem * ssb_ioremap(struct ssb_bus *bus,
 #ifdef CONFIG_SSB_PCIHOST
                mmio = pci_iomap(bus->host_pci, 0, ~0UL);
 #else
 #ifdef CONFIG_SSB_PCIHOST
                mmio = pci_iomap(bus->host_pci, 0, ~0UL);
 #else
-               assert(0); /* Can't reach this code. */
+               SSB_BUG_ON(1); /* Can't reach this code. */
 #endif
                break;
        }
 #endif
                break;
        }
@@ -390,6 +388,17 @@ int ssb_bus_scan(struct ssb_bus *bus,
                case SSB_DEV_PCI:
                case SSB_DEV_PCIE:
 #ifdef CONFIG_SSB_DRIVER_PCICORE
                case SSB_DEV_PCI:
                case SSB_DEV_PCIE:
 #ifdef CONFIG_SSB_DRIVER_PCICORE
+                       if (bus->bustype == SSB_BUSTYPE_PCI) {
+                               /* Ignore PCI cores on PCI-E cards.
+                                * Ignore PCI-E cores on PCI cards. */
+                               if (dev->id.coreid == SSB_DEV_PCI) {
+                                       if (bus->host_pci->is_pcie)
+                                               continue;
+                               } else {
+                                       if (!bus->host_pci->is_pcie)
+                                               continue;
+                               }
+                       }
                        if (bus->pcicore.dev) {
                                ssb_printk(KERN_WARNING PFX
                                           "WARNING: Multiple PCI(E) cores found\n");
                        if (bus->pcicore.dev) {
                                ssb_printk(KERN_WARNING PFX
                                           "WARNING: Multiple PCI(E) cores found\n");
This page took 0.026548 seconds and 4 git commands to generate.