aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/pdc202xx_old.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/pdc202xx_old.c')
-rw-r--r--drivers/ide/pci/pdc202xx_old.c49
1 files changed, 29 insertions, 20 deletions
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index e54dc653b8c4..6ff2def58da0 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -20,6 +20,8 @@
20 20
21#include <asm/io.h> 21#include <asm/io.h>
22 22
23#define DRV_NAME "pdc202xx_old"
24
23#define PDC202XX_DEBUG_DRIVE_INFO 0 25#define PDC202XX_DEBUG_DRIVE_INFO 0
24 26
25static const char *pdc_quirk_drives[] = { 27static const char *pdc_quirk_drives[] = {
@@ -263,8 +265,7 @@ static void pdc202xx_dma_timeout(ide_drive_t *drive)
263 ide_dma_timeout(drive); 265 ide_dma_timeout(drive);
264} 266}
265 267
266static unsigned int __devinit init_chipset_pdc202xx(struct pci_dev *dev, 268static unsigned int __devinit init_chipset_pdc202xx(struct pci_dev *dev)
267 const char *name)
268{ 269{
269 unsigned long dmabase = pci_resource_start(dev, 4); 270 unsigned long dmabase = pci_resource_start(dev, 4);
270 u8 udma_speed_flag = 0, primary_mode = 0, secondary_mode = 0; 271 u8 udma_speed_flag = 0, primary_mode = 0, secondary_mode = 0;
@@ -304,8 +305,8 @@ static void __devinit pdc202ata4_fixup_irq(struct pci_dev *dev,
304 if (irq != irq2) { 305 if (irq != irq2) {
305 pci_write_config_byte(dev, 306 pci_write_config_byte(dev,
306 (PCI_INTERRUPT_LINE)|0x80, irq); /* 0xbc */ 307 (PCI_INTERRUPT_LINE)|0x80, irq); /* 0xbc */
307 printk(KERN_INFO "%s: PCI config space interrupt " 308 printk(KERN_INFO "%s %s: PCI config space interrupt "
308 "mirror fixed\n", name); 309 "mirror fixed\n", name, pci_name(dev));
309 } 310 }
310 } 311 }
311} 312}
@@ -350,9 +351,9 @@ static const struct ide_dma_ops pdc2026x_dma_ops = {
350 .dma_timeout = pdc202xx_dma_timeout, 351 .dma_timeout = pdc202xx_dma_timeout,
351}; 352};
352 353
353#define DECLARE_PDC2026X_DEV(name_str, udma, extra_flags) \ 354#define DECLARE_PDC2026X_DEV(udma, extra_flags) \
354 { \ 355 { \
355 .name = name_str, \ 356 .name = DRV_NAME, \
356 .init_chipset = init_chipset_pdc202xx, \ 357 .init_chipset = init_chipset_pdc202xx, \
357 .port_ops = &pdc2026x_port_ops, \ 358 .port_ops = &pdc2026x_port_ops, \
358 .dma_ops = &pdc2026x_dma_ops, \ 359 .dma_ops = &pdc2026x_dma_ops, \
@@ -363,8 +364,8 @@ static const struct ide_dma_ops pdc2026x_dma_ops = {
363 } 364 }
364 365
365static const struct ide_port_info pdc202xx_chipsets[] __devinitdata = { 366static const struct ide_port_info pdc202xx_chipsets[] __devinitdata = {
366 { /* 0 */ 367 { /* 0: PDC20246 */
367 .name = "PDC20246", 368 .name = DRV_NAME,
368 .init_chipset = init_chipset_pdc202xx, 369 .init_chipset = init_chipset_pdc202xx,
369 .port_ops = &pdc20246_port_ops, 370 .port_ops = &pdc20246_port_ops,
370 .dma_ops = &pdc20246_dma_ops, 371 .dma_ops = &pdc20246_dma_ops,
@@ -374,10 +375,10 @@ static const struct ide_port_info pdc202xx_chipsets[] __devinitdata = {
374 .udma_mask = ATA_UDMA2, 375 .udma_mask = ATA_UDMA2,
375 }, 376 },
376 377
377 /* 1 */ DECLARE_PDC2026X_DEV("PDC20262", ATA_UDMA4, 0), 378 /* 1: PDC2026{2,3} */
378 /* 2 */ DECLARE_PDC2026X_DEV("PDC20263", ATA_UDMA4, 0), 379 DECLARE_PDC2026X_DEV(ATA_UDMA4, 0),
379 /* 3 */ DECLARE_PDC2026X_DEV("PDC20265", ATA_UDMA5, IDE_HFLAG_RQSIZE_256), 380 /* 2: PDC2026{5,7} */
380 /* 4 */ DECLARE_PDC2026X_DEV("PDC20267", ATA_UDMA5, IDE_HFLAG_RQSIZE_256), 381 DECLARE_PDC2026X_DEV(ATA_UDMA5, IDE_HFLAG_RQSIZE_256),
381}; 382};
382 383
383/** 384/**
@@ -396,31 +397,32 @@ static int __devinit pdc202xx_init_one(struct pci_dev *dev, const struct pci_dev
396 397
397 d = &pdc202xx_chipsets[idx]; 398 d = &pdc202xx_chipsets[idx];
398 399
399 if (idx < 3) 400 if (idx < 2)
400 pdc202ata4_fixup_irq(dev, d->name); 401 pdc202ata4_fixup_irq(dev, d->name);
401 402
402 if (idx == 3) { 403 if (dev->vendor == PCI_DEVICE_ID_PROMISE_20265) {
403 struct pci_dev *bridge = dev->bus->self; 404 struct pci_dev *bridge = dev->bus->self;
404 405
405 if (bridge && 406 if (bridge &&
406 bridge->vendor == PCI_VENDOR_ID_INTEL && 407 bridge->vendor == PCI_VENDOR_ID_INTEL &&
407 (bridge->device == PCI_DEVICE_ID_INTEL_I960 || 408 (bridge->device == PCI_DEVICE_ID_INTEL_I960 ||
408 bridge->device == PCI_DEVICE_ID_INTEL_I960RM)) { 409 bridge->device == PCI_DEVICE_ID_INTEL_I960RM)) {
409 printk(KERN_INFO "ide: Skipping Promise PDC20265 " 410 printk(KERN_INFO DRV_NAME " %s: skipping Promise "
410 "attached to I2O RAID controller\n"); 411 "PDC20265 attached to I2O RAID controller\n",
412 pci_name(dev));
411 return -ENODEV; 413 return -ENODEV;
412 } 414 }
413 } 415 }
414 416
415 return ide_setup_pci_device(dev, d); 417 return ide_pci_init_one(dev, d, NULL);
416} 418}
417 419
418static const struct pci_device_id pdc202xx_pci_tbl[] = { 420static const struct pci_device_id pdc202xx_pci_tbl[] = {
419 { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20246), 0 }, 421 { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20246), 0 },
420 { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20262), 1 }, 422 { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20262), 1 },
421 { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20263), 2 }, 423 { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20263), 1 },
422 { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20265), 3 }, 424 { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20265), 2 },
423 { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20267), 4 }, 425 { PCI_VDEVICE(PROMISE, PCI_DEVICE_ID_PROMISE_20267), 2 },
424 { 0, }, 426 { 0, },
425}; 427};
426MODULE_DEVICE_TABLE(pci, pdc202xx_pci_tbl); 428MODULE_DEVICE_TABLE(pci, pdc202xx_pci_tbl);
@@ -429,6 +431,7 @@ static struct pci_driver driver = {
429 .name = "Promise_Old_IDE", 431 .name = "Promise_Old_IDE",
430 .id_table = pdc202xx_pci_tbl, 432 .id_table = pdc202xx_pci_tbl,
431 .probe = pdc202xx_init_one, 433 .probe = pdc202xx_init_one,
434 .remove = ide_pci_remove,
432}; 435};
433 436
434static int __init pdc202xx_ide_init(void) 437static int __init pdc202xx_ide_init(void)
@@ -436,7 +439,13 @@ static int __init pdc202xx_ide_init(void)
436 return ide_pci_register_driver(&driver); 439 return ide_pci_register_driver(&driver);
437} 440}
438 441
442static void __exit pdc202xx_ide_exit(void)
443{
444 pci_unregister_driver(&driver);
445}
446
439module_init(pdc202xx_ide_init); 447module_init(pdc202xx_ide_init);
448module_exit(pdc202xx_ide_exit);
440 449
441MODULE_AUTHOR("Andre Hedrick, Frank Tiernan"); 450MODULE_AUTHOR("Andre Hedrick, Frank Tiernan");
442MODULE_DESCRIPTION("PCI driver module for older Promise IDE"); 451MODULE_DESCRIPTION("PCI driver module for older Promise IDE");