Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-only
0002 /*
0003  * Virtual EISA root driver.
0004  * Acts as a placeholder if we don't have a proper EISA bridge.
0005  *
0006  * (C) 2003 Marc Zyngier <maz@wild-wind.fr.eu.org>
0007  */
0008 
0009 #include <linux/kernel.h>
0010 #include <linux/platform_device.h>
0011 #include <linux/eisa.h>
0012 #include <linux/module.h>
0013 #include <linux/moduleparam.h>
0014 #include <linux/init.h>
0015 
0016 #if defined(CONFIG_ALPHA_JENSEN) || defined(CONFIG_EISA_VLB_PRIMING)
0017 #define EISA_FORCE_PROBE_DEFAULT 1
0018 #else
0019 #define EISA_FORCE_PROBE_DEFAULT 0
0020 #endif
0021 
0022 static int force_probe = EISA_FORCE_PROBE_DEFAULT;
0023 static void virtual_eisa_release (struct device *);
0024 
0025 /* The default EISA device parent (virtual root device).
0026  * Now use a platform device, since that's the obvious choice. */
0027 
0028 static struct platform_device eisa_root_dev = {
0029     .name = "eisa",
0030     .id   = 0,
0031     .dev  = {
0032         .release = virtual_eisa_release,
0033     },
0034 };
0035 
0036 static struct eisa_root_device eisa_bus_root = {
0037     .dev        = &eisa_root_dev.dev,
0038     .bus_base_addr  = 0,
0039     .res        = &ioport_resource,
0040     .slots      = EISA_MAX_SLOTS,
0041     .dma_mask   = 0xffffffff,
0042 };
0043 
0044 static void virtual_eisa_release (struct device *dev)
0045 {
0046     /* nothing really to do here */
0047 }
0048 
0049 static int __init virtual_eisa_root_init (void)
0050 {
0051     int r;
0052 
0053     if ((r = platform_device_register (&eisa_root_dev)))
0054         return r;
0055 
0056     eisa_bus_root.force_probe = force_probe;
0057 
0058     dev_set_drvdata(&eisa_root_dev.dev, &eisa_bus_root);
0059 
0060     if (eisa_root_register (&eisa_bus_root)) {
0061         /* A real bridge may have been registered before
0062          * us. So quietly unregister. */
0063         platform_device_unregister (&eisa_root_dev);
0064         return -1;
0065     }
0066 
0067     return 0;
0068 }
0069 
0070 module_param (force_probe, int, 0444);
0071 
0072 device_initcall (virtual_eisa_root_init);