blob: 0d42ea791060a3e6662e4ac9b2f80d24487cc570 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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
12#include <linux/kernel.h>
13#include <linux/device.h>
14#include <linux/eisa.h>
15#include <linux/pci.h>
16#include <linux/module.h>
17#include <linux/init.h>
18
19/* There is only *one* pci_eisa device per machine, right ? */
20static struct eisa_root_device pci_eisa_root;
21
Adrian Bunk74b9a292007-03-26 21:32:27 -080022static int __init pci_eisa_init(struct pci_dev *pdev,
23 const struct pci_device_id *ent)
Linus Torvalds1da177e2005-04-16 15:20:36 -070024{
25 int rc;
26
27 if ((rc = pci_enable_device (pdev))) {
Bjorn Helgaas4cf9f242013-04-15 14:33:42 -060028 dev_err(&pdev->dev, "Could not enable device\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -070029 return rc;
30 }
31
32 pci_eisa_root.dev = &pdev->dev;
Linus Torvalds1da177e2005-04-16 15:20:36 -070033 pci_eisa_root.res = pdev->bus->resource[0];
34 pci_eisa_root.bus_base_addr = pdev->bus->resource[0]->start;
35 pci_eisa_root.slots = EISA_MAX_SLOTS;
36 pci_eisa_root.dma_mask = pdev->dma_mask;
Greg Kroah-Hartman4b9d0d32009-04-30 14:43:31 -070037 dev_set_drvdata(pci_eisa_root.dev, &pci_eisa_root);
Linus Torvalds1da177e2005-04-16 15:20:36 -070038
39 if (eisa_root_register (&pci_eisa_root)) {
Bjorn Helgaas4cf9f242013-04-15 14:33:42 -060040 dev_err(&pdev->dev, "Could not register EISA root\n");
Linus Torvalds1da177e2005-04-16 15:20:36 -070041 return -1;
42 }
43
44 return 0;
45}
46
Arnaud Lacombe82de9a02011-08-04 10:39:44 -040047static struct pci_device_id pci_eisa_pci_tbl[] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -070048 { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID,
49 PCI_CLASS_BRIDGE_EISA << 8, 0xffff00, 0 },
50 { 0, }
51};
52
Arnaud Lacombe82de9a02011-08-04 10:39:44 -040053static struct pci_driver __refdata pci_eisa_driver = {
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 .name = "pci_eisa",
55 .id_table = pci_eisa_pci_tbl,
56 .probe = pci_eisa_init,
57};
58
59static int __init pci_eisa_init_module (void)
60{
61 return pci_register_driver (&pci_eisa_driver);
62}
63
64device_initcall(pci_eisa_init_module);
65MODULE_DEVICE_TABLE(pci, pci_eisa_pci_tbl);