diff options
Diffstat (limited to 'drivers/ide/pci/generic.c')
-rw-r--r-- | drivers/ide/pci/generic.c | 78 |
1 files changed, 41 insertions, 37 deletions
diff --git a/drivers/ide/pci/generic.c b/drivers/ide/pci/generic.c index 041720e22762..b07d4f4273b3 100644 --- a/drivers/ide/pci/generic.c +++ b/drivers/ide/pci/generic.c | |||
@@ -27,6 +27,8 @@ | |||
27 | #include <linux/ide.h> | 27 | #include <linux/ide.h> |
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | 29 | ||
30 | #define DRV_NAME "ide_pci_generic" | ||
31 | |||
30 | static int ide_generic_all; /* Set to claim all devices */ | 32 | static int ide_generic_all; /* Set to claim all devices */ |
31 | 33 | ||
32 | module_param_named(all_generic_ide, ide_generic_all, bool, 0444); | 34 | module_param_named(all_generic_ide, ide_generic_all, bool, 0444); |
@@ -34,9 +36,9 @@ MODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE st | |||
34 | 36 | ||
35 | #define IDE_HFLAGS_UMC (IDE_HFLAG_NO_DMA | IDE_HFLAG_FORCE_LEGACY_IRQS) | 37 | #define IDE_HFLAGS_UMC (IDE_HFLAG_NO_DMA | IDE_HFLAG_FORCE_LEGACY_IRQS) |
36 | 38 | ||
37 | #define DECLARE_GENERIC_PCI_DEV(name_str, extra_flags) \ | 39 | #define DECLARE_GENERIC_PCI_DEV(extra_flags) \ |
38 | { \ | 40 | { \ |
39 | .name = name_str, \ | 41 | .name = DRV_NAME, \ |
40 | .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | \ | 42 | .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | \ |
41 | extra_flags, \ | 43 | extra_flags, \ |
42 | .swdma_mask = ATA_SWDMA2, \ | 44 | .swdma_mask = ATA_SWDMA2, \ |
@@ -45,10 +47,11 @@ MODULE_PARM_DESC(all_generic_ide, "IDE generic will claim all unknown PCI IDE st | |||
45 | } | 47 | } |
46 | 48 | ||
47 | static const struct ide_port_info generic_chipsets[] __devinitdata = { | 49 | static const struct ide_port_info generic_chipsets[] __devinitdata = { |
48 | /* 0 */ DECLARE_GENERIC_PCI_DEV("Unknown", 0), | 50 | /* 0: Unknown */ |
51 | DECLARE_GENERIC_PCI_DEV(0), | ||
49 | 52 | ||
50 | { /* 1 */ | 53 | { /* 1: NS87410 */ |
51 | .name = "NS87410", | 54 | .name = DRV_NAME, |
52 | .enablebits = { {0x43, 0x08, 0x08}, {0x47, 0x08, 0x08} }, | 55 | .enablebits = { {0x43, 0x08, 0x08}, {0x47, 0x08, 0x08} }, |
53 | .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, | 56 | .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA, |
54 | .swdma_mask = ATA_SWDMA2, | 57 | .swdma_mask = ATA_SWDMA2, |
@@ -56,17 +59,15 @@ static const struct ide_port_info generic_chipsets[] __devinitdata = { | |||
56 | .udma_mask = ATA_UDMA6, | 59 | .udma_mask = ATA_UDMA6, |
57 | }, | 60 | }, |
58 | 61 | ||
59 | /* 2 */ DECLARE_GENERIC_PCI_DEV("SAMURAI", 0), | 62 | /* 2: SAMURAI / HT6565 / HINT_IDE */ |
60 | /* 3 */ DECLARE_GENERIC_PCI_DEV("HT6565", 0), | 63 | DECLARE_GENERIC_PCI_DEV(0), |
61 | /* 4 */ DECLARE_GENERIC_PCI_DEV("UM8673F", IDE_HFLAGS_UMC), | 64 | /* 3: UM8673F / UM8886A / UM8886BF */ |
62 | /* 5 */ DECLARE_GENERIC_PCI_DEV("UM8886A", IDE_HFLAGS_UMC), | 65 | DECLARE_GENERIC_PCI_DEV(IDE_HFLAGS_UMC), |
63 | /* 6 */ DECLARE_GENERIC_PCI_DEV("UM8886BF", IDE_HFLAGS_UMC), | 66 | /* 4: VIA_IDE / OPTI621V / Piccolo010{2,3,5} */ |
64 | /* 7 */ DECLARE_GENERIC_PCI_DEV("HINT_IDE", 0), | 67 | DECLARE_GENERIC_PCI_DEV(IDE_HFLAG_NO_AUTODMA), |
65 | /* 8 */ DECLARE_GENERIC_PCI_DEV("VIA_IDE", IDE_HFLAG_NO_AUTODMA), | 68 | |
66 | /* 9 */ DECLARE_GENERIC_PCI_DEV("OPTI621V", IDE_HFLAG_NO_AUTODMA), | 69 | { /* 5: VIA8237SATA */ |
67 | 70 | .name = DRV_NAME, | |
68 | { /* 10 */ | ||
69 | .name = "VIA8237SATA", | ||
70 | .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | | 71 | .host_flags = IDE_HFLAG_TRUST_BIOS_FOR_DMA | |
71 | IDE_HFLAG_OFF_BOARD, | 72 | IDE_HFLAG_OFF_BOARD, |
72 | .swdma_mask = ATA_SWDMA2, | 73 | .swdma_mask = ATA_SWDMA2, |
@@ -74,12 +75,8 @@ static const struct ide_port_info generic_chipsets[] __devinitdata = { | |||
74 | .udma_mask = ATA_UDMA6, | 75 | .udma_mask = ATA_UDMA6, |
75 | }, | 76 | }, |
76 | 77 | ||
77 | /* 11 */ DECLARE_GENERIC_PCI_DEV("Piccolo0102", IDE_HFLAG_NO_AUTODMA), | 78 | { /* 6: Revolution */ |
78 | /* 12 */ DECLARE_GENERIC_PCI_DEV("Piccolo0103", IDE_HFLAG_NO_AUTODMA), | 79 | .name = DRV_NAME, |
79 | /* 13 */ DECLARE_GENERIC_PCI_DEV("Piccolo0105", IDE_HFLAG_NO_AUTODMA), | ||
80 | |||
81 | { /* 14 */ | ||
82 | .name = "Revolution", | ||
83 | .host_flags = IDE_HFLAG_CLEAR_SIMPLEX | | 80 | .host_flags = IDE_HFLAG_CLEAR_SIMPLEX | |
84 | IDE_HFLAG_TRUST_BIOS_FOR_DMA | | 81 | IDE_HFLAG_TRUST_BIOS_FOR_DMA | |
85 | IDE_HFLAG_OFF_BOARD, | 82 | IDE_HFLAG_OFF_BOARD, |
@@ -134,12 +131,12 @@ static int __devinit generic_init_one(struct pci_dev *dev, const struct pci_devi | |||
134 | u16 command; | 131 | u16 command; |
135 | pci_read_config_word(dev, PCI_COMMAND, &command); | 132 | pci_read_config_word(dev, PCI_COMMAND, &command); |
136 | if (!(command & PCI_COMMAND_IO)) { | 133 | if (!(command & PCI_COMMAND_IO)) { |
137 | printk(KERN_INFO "Skipping disabled %s IDE " | 134 | printk(KERN_INFO "%s %s: skipping disabled " |
138 | "controller.\n", d->name); | 135 | "controller\n", d->name, pci_name(dev)); |
139 | goto out; | 136 | goto out; |
140 | } | 137 | } |
141 | } | 138 | } |
142 | ret = ide_setup_pci_device(dev, d); | 139 | ret = ide_pci_init_one(dev, d, NULL); |
143 | out: | 140 | out: |
144 | return ret; | 141 | return ret; |
145 | } | 142 | } |
@@ -147,20 +144,20 @@ out: | |||
147 | static const struct pci_device_id generic_pci_tbl[] = { | 144 | static const struct pci_device_id generic_pci_tbl[] = { |
148 | { PCI_VDEVICE(NS, PCI_DEVICE_ID_NS_87410), 1 }, | 145 | { PCI_VDEVICE(NS, PCI_DEVICE_ID_NS_87410), 1 }, |
149 | { PCI_VDEVICE(PCTECH, PCI_DEVICE_ID_PCTECH_SAMURAI_IDE), 2 }, | 146 | { PCI_VDEVICE(PCTECH, PCI_DEVICE_ID_PCTECH_SAMURAI_IDE), 2 }, |
150 | { PCI_VDEVICE(HOLTEK, PCI_DEVICE_ID_HOLTEK_6565), 3 }, | 147 | { PCI_VDEVICE(HOLTEK, PCI_DEVICE_ID_HOLTEK_6565), 2 }, |
151 | { PCI_VDEVICE(UMC, PCI_DEVICE_ID_UMC_UM8673F), 4 }, | 148 | { PCI_VDEVICE(UMC, PCI_DEVICE_ID_UMC_UM8673F), 3 }, |
152 | { PCI_VDEVICE(UMC, PCI_DEVICE_ID_UMC_UM8886A), 5 }, | 149 | { PCI_VDEVICE(UMC, PCI_DEVICE_ID_UMC_UM8886A), 3 }, |
153 | { PCI_VDEVICE(UMC, PCI_DEVICE_ID_UMC_UM8886BF), 6 }, | 150 | { PCI_VDEVICE(UMC, PCI_DEVICE_ID_UMC_UM8886BF), 3 }, |
154 | { PCI_VDEVICE(HINT, PCI_DEVICE_ID_HINT_VXPROII_IDE), 7 }, | 151 | { PCI_VDEVICE(HINT, PCI_DEVICE_ID_HINT_VXPROII_IDE), 2 }, |
155 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C561), 8 }, | 152 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_82C561), 4 }, |
156 | { PCI_VDEVICE(OPTI, PCI_DEVICE_ID_OPTI_82C558), 9 }, | 153 | { PCI_VDEVICE(OPTI, PCI_DEVICE_ID_OPTI_82C558), 4 }, |
157 | #ifdef CONFIG_BLK_DEV_IDE_SATA | 154 | #ifdef CONFIG_BLK_DEV_IDE_SATA |
158 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8237_SATA), 10 }, | 155 | { PCI_VDEVICE(VIA, PCI_DEVICE_ID_VIA_8237_SATA), 5 }, |
159 | #endif | 156 | #endif |
160 | { PCI_VDEVICE(TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO), 11 }, | 157 | { PCI_VDEVICE(TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO), 4 }, |
161 | { PCI_VDEVICE(TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO_1), 12 }, | 158 | { PCI_VDEVICE(TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO_1), 4 }, |
162 | { PCI_VDEVICE(TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO_2), 13 }, | 159 | { PCI_VDEVICE(TOSHIBA, PCI_DEVICE_ID_TOSHIBA_PICCOLO_2), 4 }, |
163 | { PCI_VDEVICE(NETCELL, PCI_DEVICE_ID_REVOLUTION), 14 }, | 160 | { PCI_VDEVICE(NETCELL, PCI_DEVICE_ID_REVOLUTION), 6 }, |
164 | /* | 161 | /* |
165 | * Must come last. If you add entries adjust | 162 | * Must come last. If you add entries adjust |
166 | * this table and generic_chipsets[] appropriately. | 163 | * this table and generic_chipsets[] appropriately. |
@@ -174,6 +171,7 @@ static struct pci_driver driver = { | |||
174 | .name = "PCI_IDE", | 171 | .name = "PCI_IDE", |
175 | .id_table = generic_pci_tbl, | 172 | .id_table = generic_pci_tbl, |
176 | .probe = generic_init_one, | 173 | .probe = generic_init_one, |
174 | .remove = ide_pci_remove, | ||
177 | }; | 175 | }; |
178 | 176 | ||
179 | static int __init generic_ide_init(void) | 177 | static int __init generic_ide_init(void) |
@@ -181,7 +179,13 @@ static int __init generic_ide_init(void) | |||
181 | return ide_pci_register_driver(&driver); | 179 | return ide_pci_register_driver(&driver); |
182 | } | 180 | } |
183 | 181 | ||
182 | static void __exit generic_ide_exit(void) | ||
183 | { | ||
184 | pci_unregister_driver(&driver); | ||
185 | } | ||
186 | |||
184 | module_init(generic_ide_init); | 187 | module_init(generic_ide_init); |
188 | module_exit(generic_ide_exit); | ||
185 | 189 | ||
186 | MODULE_AUTHOR("Andre Hedrick"); | 190 | MODULE_AUTHOR("Andre Hedrick"); |
187 | MODULE_DESCRIPTION("PCI driver module for generic PCI IDE"); | 191 | MODULE_DESCRIPTION("PCI driver module for generic PCI IDE"); |