diff options
Diffstat (limited to 'drivers/ide/pci/sis5513.c')
| -rw-r--r-- | drivers/ide/pci/sis5513.c | 39 |
1 files changed, 29 insertions, 10 deletions
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c index 2389945ca95..cc95f90b53b 100644 --- a/drivers/ide/pci/sis5513.c +++ b/drivers/ide/pci/sis5513.c | |||
| @@ -52,6 +52,8 @@ | |||
| 52 | #include <linux/init.h> | 52 | #include <linux/init.h> |
| 53 | #include <linux/ide.h> | 53 | #include <linux/ide.h> |
| 54 | 54 | ||
| 55 | #define DRV_NAME "sis5513" | ||
| 56 | |||
| 55 | /* registers layout and init values are chipset family dependant */ | 57 | /* registers layout and init values are chipset family dependant */ |
| 56 | 58 | ||
| 57 | #define ATA_16 0x01 | 59 | #define ATA_16 0x01 |
| @@ -380,8 +382,9 @@ static int __devinit sis_find_family(struct pci_dev *dev) | |||
| 380 | } | 382 | } |
| 381 | pci_dev_put(host); | 383 | pci_dev_put(host); |
| 382 | 384 | ||
| 383 | printk(KERN_INFO "SIS5513: %s %s controller\n", | 385 | printk(KERN_INFO DRV_NAME " %s: %s %s controller\n", |
| 384 | SiSHostChipInfo[i].name, chipset_capability[chipset_family]); | 386 | pci_name(dev), SiSHostChipInfo[i].name, |
| 387 | chipset_capability[chipset_family]); | ||
| 385 | } | 388 | } |
| 386 | 389 | ||
| 387 | if (!chipset_family) { /* Belongs to pci-quirks */ | 390 | if (!chipset_family) { /* Belongs to pci-quirks */ |
| @@ -396,7 +399,8 @@ static int __devinit sis_find_family(struct pci_dev *dev) | |||
| 396 | pci_write_config_dword(dev, 0x54, idemisc); | 399 | pci_write_config_dword(dev, 0x54, idemisc); |
| 397 | 400 | ||
| 398 | if (trueid == 0x5518) { | 401 | if (trueid == 0x5518) { |
| 399 | printk(KERN_INFO "SIS5513: SiS 962/963 MuTIOL IDE UDMA133 controller\n"); | 402 | printk(KERN_INFO DRV_NAME " %s: SiS 962/963 MuTIOL IDE UDMA133 controller\n", |
| 403 | pci_name(dev)); | ||
| 400 | chipset_family = ATA_133; | 404 | chipset_family = ATA_133; |
| 401 | 405 | ||
| 402 | /* Check for 5513 compability mapping | 406 | /* Check for 5513 compability mapping |
| @@ -405,7 +409,8 @@ static int __devinit sis_find_family(struct pci_dev *dev) | |||
| 405 | */ | 409 | */ |
| 406 | if ((idemisc & 0x40000000) == 0) { | 410 | if ((idemisc & 0x40000000) == 0) { |
| 407 | pci_write_config_dword(dev, 0x54, idemisc | 0x40000000); | 411 | pci_write_config_dword(dev, 0x54, idemisc | 0x40000000); |
| 408 | printk(KERN_INFO "SIS5513: Switching to 5513 register mapping\n"); | 412 | printk(KERN_INFO DRV_NAME " %s: Switching to 5513 register mapping\n", |
| 413 | pci_name(dev)); | ||
| 409 | } | 414 | } |
| 410 | } | 415 | } |
| 411 | } | 416 | } |
| @@ -429,10 +434,12 @@ static int __devinit sis_find_family(struct pci_dev *dev) | |||
| 429 | pci_dev_put(lpc_bridge); | 434 | pci_dev_put(lpc_bridge); |
| 430 | 435 | ||
| 431 | if (lpc_bridge->revision == 0x10 && (prefctl & 0x80)) { | 436 | if (lpc_bridge->revision == 0x10 && (prefctl & 0x80)) { |
| 432 | printk(KERN_INFO "SIS5513: SiS 961B MuTIOL IDE UDMA133 controller\n"); | 437 | printk(KERN_INFO DRV_NAME " %s: SiS 961B MuTIOL IDE UDMA133 controller\n", |
| 438 | pci_name(dev)); | ||
| 433 | chipset_family = ATA_133a; | 439 | chipset_family = ATA_133a; |
| 434 | } else { | 440 | } else { |
| 435 | printk(KERN_INFO "SIS5513: SiS 961 MuTIOL IDE UDMA100 controller\n"); | 441 | printk(KERN_INFO DRV_NAME " %s: SiS 961 MuTIOL IDE UDMA100 controller\n", |
| 442 | pci_name(dev)); | ||
| 436 | chipset_family = ATA_100; | 443 | chipset_family = ATA_100; |
| 437 | } | 444 | } |
| 438 | } | 445 | } |
| @@ -441,8 +448,7 @@ static int __devinit sis_find_family(struct pci_dev *dev) | |||
| 441 | return chipset_family; | 448 | return chipset_family; |
| 442 | } | 449 | } |
| 443 | 450 | ||
| 444 | static unsigned int __devinit init_chipset_sis5513(struct pci_dev *dev, | 451 | static unsigned int __devinit init_chipset_sis5513(struct pci_dev *dev) |
| 445 | const char *name) | ||
| 446 | { | 452 | { |
| 447 | /* Make general config ops here | 453 | /* Make general config ops here |
| 448 | 1/ tell IDE channels to operate in Compatibility mode only | 454 | 1/ tell IDE channels to operate in Compatibility mode only |
| @@ -555,7 +561,7 @@ static const struct ide_port_ops sis_ata133_port_ops = { | |||
| 555 | }; | 561 | }; |
| 556 | 562 | ||
| 557 | static const struct ide_port_info sis5513_chipset __devinitdata = { | 563 | static const struct ide_port_info sis5513_chipset __devinitdata = { |
| 558 | .name = "SIS5513", | 564 | .name = DRV_NAME, |
| 559 | .init_chipset = init_chipset_sis5513, | 565 | .init_chipset = init_chipset_sis5513, |
| 560 | .enablebits = { {0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04} }, | 566 | .enablebits = { {0x4a, 0x02, 0x02}, {0x4a, 0x04, 0x04} }, |
| 561 | .host_flags = IDE_HFLAG_LEGACY_IRQS | IDE_HFLAG_NO_AUTODMA, | 567 | .host_flags = IDE_HFLAG_LEGACY_IRQS | IDE_HFLAG_NO_AUTODMA, |
| @@ -583,7 +589,13 @@ static int __devinit sis5513_init_one(struct pci_dev *dev, const struct pci_devi | |||
| 583 | 589 | ||
| 584 | d.udma_mask = udma_rates[chipset_family]; | 590 | d.udma_mask = udma_rates[chipset_family]; |
| 585 | 591 | ||
| 586 | return ide_setup_pci_device(dev, &d); | 592 | return ide_pci_init_one(dev, &d, NULL); |
| 593 | } | ||
| 594 | |||
| 595 | static void __devexit sis5513_remove(struct pci_dev *dev) | ||
| 596 | { | ||
| 597 | ide_pci_remove(dev); | ||
| 598 | pci_disable_device(dev); | ||
| 587 | } | 599 | } |
| 588 | 600 | ||
| 589 | static const struct pci_device_id sis5513_pci_tbl[] = { | 601 | static const struct pci_device_id sis5513_pci_tbl[] = { |
| @@ -598,6 +610,7 @@ static struct pci_driver driver = { | |||
| 598 | .name = "SIS_IDE", | 610 | .name = "SIS_IDE", |
| 599 | .id_table = sis5513_pci_tbl, | 611 | .id_table = sis5513_pci_tbl, |
| 600 | .probe = sis5513_init_one, | 612 | .probe = sis5513_init_one, |
| 613 | .remove = sis5513_remove, | ||
| 601 | }; | 614 | }; |
| 602 | 615 | ||
| 603 | static int __init sis5513_ide_init(void) | 616 | static int __init sis5513_ide_init(void) |
| @@ -605,7 +618,13 @@ static int __init sis5513_ide_init(void) | |||
| 605 | return ide_pci_register_driver(&driver); | 618 | return ide_pci_register_driver(&driver); |
| 606 | } | 619 | } |
| 607 | 620 | ||
| 621 | static void __exit sis5513_ide_exit(void) | ||
| 622 | { | ||
| 623 | pci_unregister_driver(&driver); | ||
| 624 | } | ||
| 625 | |||
| 608 | module_init(sis5513_ide_init); | 626 | module_init(sis5513_ide_init); |
| 627 | module_exit(sis5513_ide_exit); | ||
| 609 | 628 | ||
| 610 | MODULE_AUTHOR("Lionel Bouton, L C Chang, Andre Hedrick, Vojtech Pavlik"); | 629 | MODULE_AUTHOR("Lionel Bouton, L C Chang, Andre Hedrick, Vojtech Pavlik"); |
| 611 | MODULE_DESCRIPTION("PCI driver module for SIS IDE"); | 630 | MODULE_DESCRIPTION("PCI driver module for SIS IDE"); |
