pci_eisa.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. dev_err(&pdev->dev, "Could not enable device\n");
  25. return rc;
  26. }
  27. pci_eisa_root.dev = &pdev->dev;
  28. pci_eisa_root.res = pdev->bus->resource[0];
  29. pci_eisa_root.bus_base_addr = pdev->bus->resource[0]->start;
  30. pci_eisa_root.slots = EISA_MAX_SLOTS;
  31. pci_eisa_root.dma_mask = pdev->dma_mask;
  32. dev_set_drvdata(pci_eisa_root.dev, &pci_eisa_root);
  33. if (eisa_root_register (&pci_eisa_root)) {
  34. dev_err(&pdev->dev, "Could not register EISA root\n");
  35. return -1;
  36. }
  37. return 0;
  38. }
  39. static struct pci_device_id pci_eisa_pci_tbl[] = {
  40. { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
  41. PCI_CLASS_BRIDGE_EISA << 8, 0xffff00, 0 },
  42. { 0, }
  43. };
  44. static struct pci_driver __refdata pci_eisa_driver = {
  45. .name = "pci_eisa",
  46. .id_table = pci_eisa_pci_tbl,
  47. .probe = pci_eisa_init,
  48. };
  49. static int __init pci_eisa_init_module (void)
  50. {
  51. return pci_register_driver (&pci_eisa_driver);
  52. }
  53. device_initcall(pci_eisa_init_module);
  54. MODULE_DEVICE_TABLE(pci, pci_eisa_pci_tbl);