diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-19 18:32:30 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-19 18:32:30 -0400 |
commit | 283283070f2607ed759563613c044f96f1546834 (patch) | |
tree | 59fd3a65404f39cbbe4133c9c473e57dc529363d /drivers/ide/pci/alim15x3.c | |
parent | cad221aa82c6f434c1d78bee1d485b5b69c626f8 (diff) |
alim15x3: use ->host_flags and ->udma_mask fields from ide_pci_device_t
* Make a local copy of ali15x3_chipset in alim15x3_init_one() and set
->host_flags / ->udma_mask according to the controller capabilities.
* Cleanup init_hwif_common_ali15x3().
* Bump driver version.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/alim15x3.c')
-rw-r--r-- | drivers/ide/pci/alim15x3.c | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c index 1ab769b31e64..fe816fd67669 100644 --- a/drivers/ide/pci/alim15x3.c +++ b/drivers/ide/pci/alim15x3.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/ide/pci/alim15x3.c Version 0.28 Sep 15 2007 | 2 | * linux/drivers/ide/pci/alim15x3.c Version 0.29 Sep 16 2007 |
3 | * | 3 | * |
4 | * Copyright (C) 1998-2000 Michel Aubry, Maintainer | 4 | * Copyright (C) 1998-2000 Michel Aubry, Maintainer |
5 | * Copyright (C) 1998-2000 Andrzej Krzysztofowicz, Maintainer | 5 | * Copyright (C) 1998-2000 Andrzej Krzysztofowicz, Maintainer |
@@ -666,31 +666,9 @@ static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif) | |||
666 | hwif->set_dma_mode = &ali_set_dma_mode; | 666 | hwif->set_dma_mode = &ali_set_dma_mode; |
667 | hwif->udma_filter = &ali_udma_filter; | 667 | hwif->udma_filter = &ali_udma_filter; |
668 | 668 | ||
669 | /* don't use LBA48 DMA on ALi devices before rev 0xC5 */ | ||
670 | if (m5229_revision <= 0xC4) | ||
671 | hwif->host_flags |= IDE_HFLAG_NO_LBA48_DMA; | ||
672 | |||
673 | if (hwif->dma_base == 0) | 669 | if (hwif->dma_base == 0) |
674 | return; | 670 | return; |
675 | 671 | ||
676 | /* | ||
677 | * check in ->init_dma guarantees m5229_revision >= 0x20 here | ||
678 | */ | ||
679 | |||
680 | if (m5229_revision == 0x20) | ||
681 | hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA; | ||
682 | |||
683 | if (m5229_revision <= 0x20) | ||
684 | hwif->ultra_mask = 0x00; /* no udma */ | ||
685 | else if (m5229_revision < 0xC2) | ||
686 | hwif->ultra_mask = ATA_UDMA2; | ||
687 | else if (m5229_revision == 0xC2 || m5229_revision == 0xC3) | ||
688 | hwif->ultra_mask = ATA_UDMA4; | ||
689 | else if (m5229_revision == 0xC4) | ||
690 | hwif->ultra_mask = ATA_UDMA5; | ||
691 | else | ||
692 | hwif->ultra_mask = ATA_UDMA6; | ||
693 | |||
694 | hwif->dma_setup = &ali15x3_dma_setup; | 672 | hwif->dma_setup = &ali15x3_dma_setup; |
695 | 673 | ||
696 | if (hwif->cbl != ATA_CBL_PATA40_SHORT) | 674 | if (hwif->cbl != ATA_CBL_PATA40_SHORT) |
@@ -794,15 +772,34 @@ static int __devinit alim15x3_init_one(struct pci_dev *dev, const struct pci_dev | |||
794 | { }, | 772 | { }, |
795 | }; | 773 | }; |
796 | 774 | ||
797 | ide_pci_device_t *d = &ali15x3_chipset; | 775 | ide_pci_device_t d = ali15x3_chipset; |
776 | u8 rev = dev->revision; | ||
798 | 777 | ||
799 | if (pci_dev_present(ati_rs100)) | 778 | if (pci_dev_present(ati_rs100)) |
800 | printk(KERN_WARNING "alim15x3: ATI Radeon IGP Northbridge is not yet fully tested.\n"); | 779 | printk(KERN_WARNING "alim15x3: ATI Radeon IGP Northbridge is not yet fully tested.\n"); |
801 | 780 | ||
781 | /* don't use LBA48 DMA on ALi devices before rev 0xC5 */ | ||
782 | if (rev <= 0xC4) | ||
783 | d.host_flags |= IDE_HFLAG_NO_LBA48_DMA; | ||
784 | |||
785 | if (rev >= 0x20) { | ||
786 | if (rev == 0x20) | ||
787 | d.host_flags |= IDE_HFLAG_NO_ATAPI_DMA; | ||
788 | |||
789 | if (rev < 0xC2) | ||
790 | d.udma_mask = ATA_UDMA2; | ||
791 | else if (rev == 0xC2 || rev == 0xC3) | ||
792 | d.udma_mask = ATA_UDMA4; | ||
793 | else if (rev == 0xC4) | ||
794 | d.udma_mask = ATA_UDMA5; | ||
795 | else | ||
796 | d.udma_mask = ATA_UDMA6; | ||
797 | } | ||
798 | |||
802 | #if defined(CONFIG_SPARC64) | 799 | #if defined(CONFIG_SPARC64) |
803 | d->init_hwif = init_hwif_common_ali15x3; | 800 | d.init_hwif = init_hwif_common_ali15x3; |
804 | #endif /* CONFIG_SPARC64 */ | 801 | #endif /* CONFIG_SPARC64 */ |
805 | return ide_setup_pci_device(dev, d); | 802 | return ide_setup_pci_device(dev, &d); |
806 | } | 803 | } |
807 | 804 | ||
808 | 805 | ||