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/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. }
  48. eisa_bus_root.force_probe = force_probe;
  49. dev_set_drvdata(&eisa_root_dev.dev, &eisa_bus_root);
  50. if (eisa_root_register (&eisa_bus_root)) {
  51. /* A real bridge may have been registered before
  52. * us. So quietly unregister. */
  53. platform_device_unregister (&eisa_root_dev);
  54. return -1;
  55. }
  56. return 0;
  57. }
  58. module_param (force_probe, int, 0444);
  59. device_initcall (virtual_eisa_root_init);