| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * Virtual EISA root driver. | 
|  | 3 | * Acts as a placeholder if we don't have a proper EISA bridge. | 
|  | 4 | * | 
|  | 5 | * (C) 2003 Marc Zyngier <maz@wild-wind.fr.eu.org> | 
|  | 6 | * | 
|  | 7 | * This code is released under the GPL version 2. | 
|  | 8 | */ | 
|  | 9 |  | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | #include <linux/kernel.h> | 
| Russell King | d052d1b | 2005-10-29 19:07:23 +0100 | [diff] [blame] | 11 | #include <linux/platform_device.h> | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | #include <linux/eisa.h> | 
|  | 13 | #include <linux/module.h> | 
|  | 14 | #include <linux/moduleparam.h> | 
|  | 15 | #include <linux/init.h> | 
|  | 16 |  | 
|  | 17 | #if defined(CONFIG_ALPHA_JENSEN) || defined(CONFIG_EISA_VLB_PRIMING) | 
|  | 18 | #define EISA_FORCE_PROBE_DEFAULT 1 | 
|  | 19 | #else | 
|  | 20 | #define EISA_FORCE_PROBE_DEFAULT 0 | 
|  | 21 | #endif | 
|  | 22 |  | 
|  | 23 | static int force_probe = EISA_FORCE_PROBE_DEFAULT; | 
|  | 24 | static void virtual_eisa_release (struct device *); | 
|  | 25 |  | 
|  | 26 | /* The default EISA device parent (virtual root device). | 
|  | 27 | * Now use a platform device, since that's the obvious choice. */ | 
|  | 28 |  | 
|  | 29 | static struct platform_device eisa_root_dev = { | 
|  | 30 | .name = "eisa", | 
|  | 31 | .id   = 0, | 
|  | 32 | .dev  = { | 
|  | 33 | .release = virtual_eisa_release, | 
|  | 34 | }, | 
|  | 35 | }; | 
|  | 36 |  | 
|  | 37 | static struct eisa_root_device eisa_bus_root = { | 
|  | 38 | .dev           = &eisa_root_dev.dev, | 
|  | 39 | .bus_base_addr = 0, | 
|  | 40 | .res	       = &ioport_resource, | 
|  | 41 | .slots	       = EISA_MAX_SLOTS, | 
|  | 42 | .dma_mask      = 0xffffffff, | 
|  | 43 | }; | 
|  | 44 |  | 
|  | 45 | static void virtual_eisa_release (struct device *dev) | 
|  | 46 | { | 
|  | 47 | /* nothing really to do here */ | 
|  | 48 | } | 
|  | 49 |  | 
| Andrew Morton | 4a1ccb5 | 2007-05-08 00:26:02 -0700 | [diff] [blame] | 50 | static int __init virtual_eisa_root_init (void) | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | { | 
|  | 52 | int r; | 
|  | 53 |  | 
|  | 54 | if ((r = platform_device_register (&eisa_root_dev))) { | 
|  | 55 | return r; | 
|  | 56 | } | 
|  | 57 |  | 
|  | 58 | eisa_bus_root.force_probe = force_probe; | 
|  | 59 |  | 
| Greg Kroah-Hartman | 4b9d0d3 | 2009-04-30 14:43:31 -0700 | [diff] [blame] | 60 | dev_set_drvdata(&eisa_root_dev.dev, &eisa_bus_root); | 
| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 |  | 
|  | 62 | if (eisa_root_register (&eisa_bus_root)) { | 
|  | 63 | /* A real bridge may have been registered before | 
|  | 64 | * us. So quietly unregister. */ | 
|  | 65 | platform_device_unregister (&eisa_root_dev); | 
|  | 66 | return -1; | 
|  | 67 | } | 
|  | 68 |  | 
|  | 69 | return 0; | 
|  | 70 | } | 
|  | 71 |  | 
|  | 72 | module_param (force_probe, int, 0444); | 
|  | 73 |  | 
|  | 74 | device_initcall (virtual_eisa_root_init); |