qd65xx: return error value in qd_probe()
[linux-block.git] / drivers / ide / pci / rz1000.c
CommitLineData
1da177e4 1/*
1da177e4
LT
2 * Copyright (C) 1995-1998 Linus Torvalds & author (see below)
3 */
4
5/*
6 * Principal Author: mlord@pobox.com (Mark Lord)
7 *
8 * See linux/MAINTAINERS for address of current maintainer.
9 *
10 * This file provides support for disabling the buggy read-ahead
11 * mode of the RZ1000 IDE chipset, commonly used on Intel motherboards.
12 *
13 * Dunno if this fixes both ports, or only the primary port (?).
14 */
15
1da177e4
LT
16#include <linux/types.h>
17#include <linux/module.h>
18#include <linux/kernel.h>
1da177e4
LT
19#include <linux/hdreg.h>
20#include <linux/pci.h>
21#include <linux/ide.h>
22#include <linux/init.h>
23
1da177e4
LT
24static void __devinit init_hwif_rz1000 (ide_hwif_t *hwif)
25{
36501650 26 struct pci_dev *dev = to_pci_dev(hwif->dev);
1da177e4 27 u16 reg;
1da177e4 28
1da177e4
LT
29 if (!pci_read_config_word (dev, 0x40, &reg) &&
30 !pci_write_config_word(dev, 0x40, reg & 0xdfff)) {
31 printk(KERN_INFO "%s: disabled chipset read-ahead "
32 "(buggy RZ1000/RZ1001)\n", hwif->name);
33 } else {
746f312a
BZ
34 if (hwif->mate)
35 hwif->mate->serialized = hwif->serialized = 1;
807b90d0 36 hwif->host_flags |= IDE_HFLAG_NO_UNMASK_IRQS;
1da177e4
LT
37 printk(KERN_INFO "%s: serialized, disabled unmasking "
38 "(buggy RZ1000/RZ1001)\n", hwif->name);
39 }
40}
41
85620436 42static const struct ide_port_info rz1000_chipset __devinitdata = {
1da177e4
LT
43 .name = "RZ100x",
44 .init_hwif = init_hwif_rz1000,
528a572d 45 .chipset = ide_rz1000,
47b68788 46 .host_flags = IDE_HFLAG_NO_DMA | IDE_HFLAG_BOOTABLE,
1da177e4
LT
47};
48
49static int __devinit rz1000_init_one(struct pci_dev *dev, const struct pci_device_id *id)
50{
51 return ide_setup_pci_device(dev, &rz1000_chipset);
52}
53
9cbcc5e3
BZ
54static const struct pci_device_id rz1000_pci_tbl[] = {
55 { PCI_VDEVICE(PCTECH, PCI_DEVICE_ID_PCTECH_RZ1000), 0 },
56 { PCI_VDEVICE(PCTECH, PCI_DEVICE_ID_PCTECH_RZ1001), 0 },
1da177e4
LT
57 { 0, },
58};
59MODULE_DEVICE_TABLE(pci, rz1000_pci_tbl);
60
61static struct pci_driver driver = {
62 .name = "RZ1000_IDE",
63 .id_table = rz1000_pci_tbl,
64 .probe = rz1000_init_one,
65};
66
82ab1eec 67static int __init rz1000_ide_init(void)
1da177e4
LT
68{
69 return ide_pci_register_driver(&driver);
70}
71
72module_init(rz1000_ide_init);
73
74MODULE_AUTHOR("Andre Hedrick");
75MODULE_DESCRIPTION("PCI driver module for RZ1000 IDE");
76MODULE_LICENSE("GPL");
77