pci_eisa.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Minimalist driver for a generic PCI-to-EISA bridge.
  3. *
  4. * (C) 2003 Marc Zyngier <maz@wild-wind.fr.eu.org>
  5. *
  6. * This code is released under the GPL version 2.
  7. *
  8. * Ivan Kokshaysky <ink@jurassic.park.msu.ru> :
  9. * Generalisation from i82375 to PCI_CLASS_BRIDGE_EISA.
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/device.h>
  13. #include <linux/eisa.h>
  14. #include <linux/pci.h>
  15. #include <linux/module.h>
  16. #include <linux/init.h>
  17. /* There is only *one* pci_eisa device per machine, right ? */
  18. static struct eisa_root_device pci_eisa_root;
  19. static int __init pci_eisa_init(struct pci_dev *pdev,
  20. const struct pci_device_id *ent)
  21. {
  22. int rc;
  23. if ((rc = pci_enable_device (pdev))) {
  24. printk (KERN_ERR "pci_eisa : Could not enable device %s\n",
  25. pci_name(pdev));
  26. return rc;
  27. }
  28. pci_eisa_root.dev = &pdev->dev;
  29. pci_eisa_root.res = pdev->bus->resource[0];
  30. pci_eisa_root.bus_base_addr = pdev->bus->resource[0]->start;
  31. pci_eisa_root.slots = EISA_MAX_SLOTS;
  32. pci_eisa_root.dma_mask = pdev->dma_mask;
  33. dev_set_drvdata(pci_eisa_root.dev, &pci_eisa_root);
  34. if (eisa_root_register (&pci_eisa_root)) {
  35. printk (KERN_ERR "pci_eisa : Could not register EISA root\n");
  36. return -1;
  37. }
  38. return 0;
  39. }
  40. static struct pci_device_id pci_eisa_pci_tbl[] = {
  41. { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
  42. PCI_CLASS_BRIDGE_EISA << 8, 0xffff00, 0 },
  43. { 0, }
  44. };
  45. static struct pci_driver pci_eisa_driver = {
  46. .name = "pci_eisa",
  47. .id_table = pci_eisa_pci_tbl,
  48. .probe = pci_eisa_init,
  49. };
  50. static int __init pci_eisa_init_module (void)
  51. {
  52. return pci_register_driver (&pci_eisa_driver);
  53. }
  54. device_initcall(pci_eisa_init_module);
  55. MODULE_DEVICE_TABLE(pci, pci_eisa_pci_tbl);