diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:24 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-04-26 16:25:24 -0400 |
commit | 5e37bdc081a980dd0d669e6387bcf15ca9666f81 (patch) | |
tree | d842166c3bd23fbf3dfba0ccaa0f9ed5cc3096db /drivers/ide/pci/alim15x3.c | |
parent | 1fd1890594bd355a4217f5658a34763e77decee3 (diff) |
ide: add struct ide_dma_ops (take 3)
Add struct ide_dma_ops and convert core code + drivers to use it.
While at it:
* Drop "ide_" prefix from ->ide_dma_end and ->ide_dma_test_irq methods.
* Drop "ide_" "infixes" from DMA methods.
* au1xxx-ide.c:
- use auide_dma_{test_irq,end}() directly in auide_dma_timeout()
* pdc202xx_old.c:
- drop "old_" "infixes" from DMA methods
* siimage.c:
- add siimage_dma_test_irq() helper
- print SATA warning in siimage_init_one()
* Remove no longer needed ->init_hwif implementations.
v2:
* Changes based on review from Sergei:
- s/siimage_ide_dma_test_irq/siimage_dma_test_irq/
- s/drive->hwif/hwif/ in idefloppy_pc_intr().
- fix patch description w.r.t. au1xxx-ide changes
- fix au1xxx-ide build
- fix naming for cmd64*_dma_ops
- drop "ide_" and "old_" infixes
- s/hpt3xxx_dma_ops/hpt37x_dma_ops/
- s/hpt370x_dma_ops/hpt370_dma_ops/
- use correct DMA ops for HPT302/N, HPT371/N and HPT374
- s/it821x_smart_dma_ops/it821x_pass_through_dma_ops/
v3:
* Two bugs slipped in v2 (noticed by Sergei):
- use correct DMA ops for HPT374 (for real this time)
- handle HPT370/HPT370A properly
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/alim15x3.c')
-rw-r--r-- | drivers/ide/pci/alim15x3.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c index 5261f308d946..987db35199e6 100644 --- a/drivers/ide/pci/alim15x3.c +++ b/drivers/ide/pci/alim15x3.c | |||
@@ -652,21 +652,7 @@ static u8 __devinit ali_cable_detect(ide_hwif_t *hwif) | |||
652 | return cbl; | 652 | return cbl; |
653 | } | 653 | } |
654 | 654 | ||
655 | /** | 655 | #ifndef CONFIG_SPARC64 |
656 | * init_hwif_common_ali15x3 - Set up ALI IDE hardware | ||
657 | * @hwif: IDE interface | ||
658 | * | ||
659 | * Initialize the IDE structure side of the ALi 15x3 driver. | ||
660 | */ | ||
661 | |||
662 | static void __devinit init_hwif_common_ali15x3 (ide_hwif_t *hwif) | ||
663 | { | ||
664 | if (hwif->dma_base == 0) | ||
665 | return; | ||
666 | |||
667 | hwif->dma_setup = &ali15x3_dma_setup; | ||
668 | } | ||
669 | |||
670 | /** | 656 | /** |
671 | * init_hwif_ali15x3 - Initialize the ALI IDE x86 stuff | 657 | * init_hwif_ali15x3 - Initialize the ALI IDE x86 stuff |
672 | * @hwif: interface to configure | 658 | * @hwif: interface to configure |
@@ -716,9 +702,8 @@ static void __devinit init_hwif_ali15x3 (ide_hwif_t *hwif) | |||
716 | if(irq >= 0) | 702 | if(irq >= 0) |
717 | hwif->irq = irq; | 703 | hwif->irq = irq; |
718 | } | 704 | } |
719 | |||
720 | init_hwif_common_ali15x3(hwif); | ||
721 | } | 705 | } |
706 | #endif | ||
722 | 707 | ||
723 | /** | 708 | /** |
724 | * init_dma_ali15x3 - set up DMA on ALi15x3 | 709 | * init_dma_ali15x3 - set up DMA on ALi15x3 |
@@ -746,7 +731,7 @@ static int __devinit init_dma_ali15x3(ide_hwif_t *hwif, | |||
746 | if (ide_allocate_dma_engine(hwif)) | 731 | if (ide_allocate_dma_engine(hwif)) |
747 | return -1; | 732 | return -1; |
748 | 733 | ||
749 | ide_setup_dma(hwif, base); | 734 | ide_setup_dma(hwif, base, d); |
750 | 735 | ||
751 | return 0; | 736 | return 0; |
752 | } | 737 | } |
@@ -758,10 +743,16 @@ static const struct ide_port_ops ali_port_ops = { | |||
758 | .cable_detect = ali_cable_detect, | 743 | .cable_detect = ali_cable_detect, |
759 | }; | 744 | }; |
760 | 745 | ||
746 | static struct ide_dma_ops ali_dma_ops = { | ||
747 | .dma_setup = ali15x3_dma_setup, | ||
748 | }; | ||
749 | |||
761 | static const struct ide_port_info ali15x3_chipset __devinitdata = { | 750 | static const struct ide_port_info ali15x3_chipset __devinitdata = { |
762 | .name = "ALI15X3", | 751 | .name = "ALI15X3", |
763 | .init_chipset = init_chipset_ali15x3, | 752 | .init_chipset = init_chipset_ali15x3, |
753 | #ifndef CONFIG_SPARC64 | ||
764 | .init_hwif = init_hwif_ali15x3, | 754 | .init_hwif = init_hwif_ali15x3, |
755 | #endif | ||
765 | .init_dma = init_dma_ali15x3, | 756 | .init_dma = init_dma_ali15x3, |
766 | .port_ops = &ali_port_ops, | 757 | .port_ops = &ali_port_ops, |
767 | .pio_mask = ATA_PIO5, | 758 | .pio_mask = ATA_PIO5, |
@@ -806,6 +797,8 @@ static int __devinit alim15x3_init_one(struct pci_dev *dev, const struct pci_dev | |||
806 | d.udma_mask = ATA_UDMA5; | 797 | d.udma_mask = ATA_UDMA5; |
807 | else | 798 | else |
808 | d.udma_mask = ATA_UDMA6; | 799 | d.udma_mask = ATA_UDMA6; |
800 | |||
801 | d.dma_ops = &ali_dma_ops; | ||
809 | } else { | 802 | } else { |
810 | d.host_flags |= IDE_HFLAG_NO_DMA; | 803 | d.host_flags |= IDE_HFLAG_NO_DMA; |
811 | 804 | ||
@@ -815,9 +808,6 @@ static int __devinit alim15x3_init_one(struct pci_dev *dev, const struct pci_dev | |||
815 | if (idx == 0) | 808 | if (idx == 0) |
816 | d.host_flags |= IDE_HFLAG_CLEAR_SIMPLEX; | 809 | d.host_flags |= IDE_HFLAG_CLEAR_SIMPLEX; |
817 | 810 | ||
818 | #if defined(CONFIG_SPARC64) | ||
819 | d.init_hwif = init_hwif_common_ali15x3; | ||
820 | #endif /* CONFIG_SPARC64 */ | ||
821 | return ide_setup_pci_device(dev, &d); | 811 | return ide_setup_pci_device(dev, &d); |
822 | } | 812 | } |
823 | 813 | ||