virtual_root.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. #include <linux/config.h>
  10. #include <linux/kernel.h>
  11. #include <linux/platform_device.h>
  12. #include <linux/eisa.h>
  13. #include <linux/module.h>
  14. #include <linux/moduleparam.h>
  15. #include <linux/init.h>
  16. #if defined(CONFIG_ALPHA_JENSEN) || defined(CONFIG_EISA_VLB_PRIMING)
  17. #define EISA_FORCE_PROBE_DEFAULT 1
  18. #else
  19. #define EISA_FORCE_PROBE_DEFAULT 0
  20. #endif
  21. static int force_probe = EISA_FORCE_PROBE_DEFAULT;
  22. static void virtual_eisa_release (struct device *);
  23. /* The default EISA device parent (virtual root device).
  24. * Now use a platform device, since that's the obvious choice. */
  25. static struct platform_device eisa_root_dev = {
  26. .name = "eisa",
  27. .id = 0,
  28. .dev = {
  29. .release = virtual_eisa_release,
  30. },
  31. };
  32. static struct eisa_root_device eisa_bus_root = {
  33. .dev = &eisa_root_dev.dev,
  34. .bus_base_addr = 0,
  35. .res = &ioport_resource,
  36. .slots = EISA_MAX_SLOTS,
  37. .dma_mask = 0xffffffff,
  38. };
  39. static void virtual_eisa_release (struct device *dev)
  40. {
  41. /* nothing really to do here */
  42. }
  43. static int virtual_eisa_root_init (void)
  44. {
  45. int r;
  46. if ((r = platform_device_register (&eisa_root_dev))) {
  47. return r;
  48. }
  49. eisa_bus_root.force_probe = force_probe;
  50. eisa_root_dev.dev.driver_data = &eisa_bus_root;
  51. if (eisa_root_register (&eisa_bus_root)) {
  52. /* A real bridge may have been registered before
  53. * us. So quietly unregister. */
  54. platform_device_unregister (&eisa_root_dev);
  55. return -1;
  56. }
  57. return 0;
  58. }
  59. module_param (force_probe, int, 0444);
  60. device_initcall (virtual_eisa_root_init);