aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sn/ioc4.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/sn/ioc4.c')
-rw-r--r--drivers/sn/ioc4.c65
1 files changed, 65 insertions, 0 deletions
diff --git a/drivers/sn/ioc4.c b/drivers/sn/ioc4.c
new file mode 100644
index 000000000000..d9e4ee280e5f
--- /dev/null
+++ b/drivers/sn/ioc4.c
@@ -0,0 +1,65 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (C) 2005 Silicon Graphics, Inc. All Rights Reserved.
7 */
8
9/*
10 * This file contains a shim driver for the IOC4 IDE and serial drivers.
11 */
12
13#include <linux/errno.h>
14#include <linux/module.h>
15#include <linux/pci.h>
16#include <linux/ioc4_common.h>
17#include <linux/ide.h>
18
19
20static int __devinit
21ioc4_probe_one(struct pci_dev *pdev, const struct pci_device_id *pci_id)
22{
23 int ret;
24
25 if ((ret = pci_enable_device(pdev))) {
26 printk(KERN_WARNING
27 "%s: Failed to enable device with "
28 "pci_dev 0x%p... returning\n",
29 __FUNCTION__, (void *)pdev);
30 return ret;
31 }
32 pci_set_master(pdev);
33
34 /* attach each sub-device */
35 ret = ioc4_ide_attach_one(pdev, pci_id);
36 if (ret)
37 return ret;
38 return ioc4_serial_attach_one(pdev, pci_id);
39}
40
41/* pci device struct */
42static struct pci_device_id ioc4_s_id_table[] = {
43 {PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC4, PCI_ANY_ID,
44 PCI_ANY_ID, 0x0b4000, 0xFFFFFF},
45 {0}
46};
47MODULE_DEVICE_TABLE(pci, ioc4_s_id_table);
48
49static struct pci_driver __devinitdata ioc4_s_driver = {
50 .name = "IOC4",
51 .id_table = ioc4_s_id_table,
52 .probe = ioc4_probe_one,
53};
54
55static int __devinit ioc4_detect(void)
56{
57 ioc4_serial_init();
58
59 return pci_register_driver(&ioc4_s_driver);
60}
61module_init(ioc4_detect);
62
63MODULE_AUTHOR("Pat Gefre - Silicon Graphics Inc. (SGI) <pfg@sgi.com>");
64MODULE_DESCRIPTION("PCI driver module for SGI IOC4 Base-IO Card");
65MODULE_LICENSE("GPL");