Commit 7c58d9bf authored by Pat Gefre's avatar Pat Gefre Committed by Linus Torvalds

[PATCH] Altix: ioc4 serial driver support

Signed-off-by: default avatarPatrick Gefre <pfg@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 4685ed5e
......@@ -61,5 +61,6 @@ obj-$(CONFIG_EISA) += eisa/
obj-$(CONFIG_CPU_FREQ) += cpufreq/
obj-$(CONFIG_MMC) += mmc/
obj-$(CONFIG_INFINIBAND) += infiniband/
obj-$(CONFIG_BLK_DEV_SGIIOC4) += sn/
obj-y += firmware/
obj-$(CONFIG_CRYPTO) += crypto/
......@@ -34,6 +34,7 @@
#include <linux/mm.h>
#include <linux/ioport.h>
#include <linux/blkdev.h>
#include <linux/ioc4_common.h>
#include <asm/io.h>
#include <linux/ide.h>
......@@ -684,15 +685,6 @@ pci_init_sgiioc4(struct pci_dev *dev, ide_pci_device_t * d)
unsigned int class_rev;
int ret;
ret = pci_enable_device(dev);
if (ret < 0) {
printk(KERN_ERR
"Failed to enable device %s at slot %s\n",
d->name, pci_name(dev));
goto out;
}
pci_set_master(dev);
pci_read_config_dword(dev, PCI_CLASS_REVISION, &class_rev);
class_rev &= 0xff;
printk(KERN_INFO "%s: IDE controller at PCI slot %s, revision %d\n",
......@@ -722,34 +714,15 @@ static ide_pci_device_t sgiioc4_chipsets[] __devinitdata = {
}
};
static int __devinit
sgiioc4_init_one(struct pci_dev *dev, const struct pci_device_id *id)
int
ioc4_ide_attach_one(struct pci_dev *dev, const struct pci_device_id *id)
{
pci_init_sgiioc4(dev, &sgiioc4_chipsets[id->driver_data]);
return 0;
return pci_init_sgiioc4(dev, &sgiioc4_chipsets[id->driver_data]);
}
static struct pci_device_id sgiioc4_pci_tbl[] = {
{PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC4, PCI_ANY_ID,
PCI_ANY_ID, 0x0b4000, 0xFFFFFF, 0},
{0}
};
MODULE_DEVICE_TABLE(pci, sgiioc4_pci_tbl);
static struct pci_driver __devinitdata driver = {
.name = "SGI-IOC4_IDE",
.id_table = sgiioc4_pci_tbl,
.probe = sgiioc4_init_one,
};
static int __devinit
sgiioc4_ide_init(void)
{
return ide_pci_register_driver(&driver);
}
module_init(sgiioc4_ide_init);
MODULE_AUTHOR("Aniket Malatpure - Silicon Graphics Inc. (SGI)");
MODULE_DESCRIPTION("PCI driver module for SGI IOC4 Base-IO Card");
MODULE_DESCRIPTION("IDE PCI driver module for SGI IOC4 Base-IO Card");
MODULE_LICENSE("GPL");
EXPORT_SYMBOL(ioc4_ide_attach_one);
......@@ -49,3 +49,4 @@ obj-$(CONFIG_SERIAL_M32R_SIO) += m32r_sio.o
obj-$(CONFIG_SERIAL_MPSC) += mpsc.o
obj-$(CONFIG_ETRAX_SERIAL) += crisv10.o
obj-$(CONFIG_SERIAL_TXX9) += serial_txx9.o
obj-$(CONFIG_BLK_DEV_SGIIOC4) += ioc4_serial.o
This diff is collapsed.
#
# Makefile for the Altix device drivers.
#
#
obj-$(CONFIG_BLK_DEV_SGIIOC4) += ioc4.o
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 2005 Silicon Graphics, Inc. All Rights Reserved.
*/
/*
* This file contains a shim driver for the IOC4 IDE and serial drivers.
*/
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/ioc4_common.h>
#include <linux/ide.h>
static int __devinit
ioc4_probe_one(struct pci_dev *pdev, const struct pci_device_id *pci_id)
{
int ret;
if ((ret = pci_enable_device(pdev))) {
printk(KERN_WARNING
"%s: Failed to enable device with "
"pci_dev 0x%p... returning\n",
__FUNCTION__, (void *)pdev);
return ret;
}
pci_set_master(pdev);
/* attach each sub-device */
ret = ioc4_ide_attach_one(pdev, pci_id);
if (ret)
return ret;
return ioc4_serial_attach_one(pdev, pci_id);
}
/* pci device struct */
static struct pci_device_id ioc4_s_id_table[] = {
{PCI_VENDOR_ID_SGI, PCI_DEVICE_ID_SGI_IOC4, PCI_ANY_ID,
PCI_ANY_ID, 0x0b4000, 0xFFFFFF},
{0}
};
MODULE_DEVICE_TABLE(pci, ioc4_s_id_table);
static struct pci_driver __devinitdata ioc4_s_driver = {
.name = "IOC4",
.id_table = ioc4_s_id_table,
.probe = ioc4_probe_one,
};
static int __devinit ioc4_detect(void)
{
ioc4_serial_init();
return pci_register_driver(&ioc4_s_driver);
}
module_init(ioc4_detect);
MODULE_AUTHOR("Pat Gefre - Silicon Graphics Inc. (SGI) <pfg@sgi.com>");
MODULE_DESCRIPTION("PCI driver module for SGI IOC4 Base-IO Card");
MODULE_LICENSE("GPL");
/*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
*/
#ifndef _LINUX_IOC4_COMMON_H
#define _LINUX_IOC4_COMMON_H
/* prototypes */
int ioc4_serial_init(void);
int ioc4_serial_attach_one(struct pci_dev *pdev, const struct
pci_device_id *pci_id);
int ioc4_ide_attach_one(struct pci_dev *pdev, const struct
pci_device_id *pci_id);
#endif /* _LINUX_IOC4_COMMON_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment