virtual_root.c 1.6 KB

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