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/mips | |
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/mips')
-rw-r--r-- | drivers/ide/mips/au1xxx-ide.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c index 54323ab64def..579caa3b06f4 100644 --- a/drivers/ide/mips/au1xxx-ide.c +++ b/drivers/ide/mips/au1xxx-ide.c | |||
@@ -366,21 +366,31 @@ static void auide_init_dbdma_dev(dbdev_tab_t *dev, u32 dev_id, u32 tsize, u32 de | |||
366 | dev->dev_devwidth = devwidth; | 366 | dev->dev_devwidth = devwidth; |
367 | dev->dev_flags = flags; | 367 | dev->dev_flags = flags; |
368 | } | 368 | } |
369 | |||
370 | #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) | ||
371 | 369 | ||
370 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | ||
372 | static void auide_dma_timeout(ide_drive_t *drive) | 371 | static void auide_dma_timeout(ide_drive_t *drive) |
373 | { | 372 | { |
374 | ide_hwif_t *hwif = HWIF(drive); | 373 | ide_hwif_t *hwif = HWIF(drive); |
375 | 374 | ||
376 | printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name); | 375 | printk(KERN_ERR "%s: DMA timeout occurred: ", drive->name); |
377 | 376 | ||
378 | if (hwif->ide_dma_test_irq(drive)) | 377 | if (auide_dma_test_irq(drive)) |
379 | return; | 378 | return; |
380 | 379 | ||
381 | hwif->ide_dma_end(drive); | 380 | auide_dma_end(drive); |
382 | } | 381 | } |
383 | 382 | ||
383 | static struct ide_dma_ops au1xxx_dma_ops = { | ||
384 | .dma_host_set = auide_dma_host_set, | ||
385 | .dma_setup = auide_dma_setup, | ||
386 | .dma_exec_cmd = auide_dma_exec_cmd, | ||
387 | .dma_start = auide_dma_start, | ||
388 | .dma_end = auide_dma_end, | ||
389 | .dma_test_irq = auide_dma_test_irq, | ||
390 | .dma_lost_irq = auide_dma_lost_irq, | ||
391 | .dma_timeout = auide_dma_timeout, | ||
392 | }; | ||
393 | |||
384 | static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d) | 394 | static int auide_ddma_init(ide_hwif_t *hwif, const struct ide_port_info *d) |
385 | { | 395 | { |
386 | _auide_hwif *auide = (_auide_hwif *)hwif->hwif_data; | 396 | _auide_hwif *auide = (_auide_hwif *)hwif->hwif_data; |
@@ -511,6 +521,9 @@ static const struct ide_port_ops au1xxx_port_ops = { | |||
511 | static const struct ide_port_info au1xxx_port_info = { | 521 | static const struct ide_port_info au1xxx_port_info = { |
512 | .init_dma = auide_ddma_init, | 522 | .init_dma = auide_ddma_init, |
513 | .port_ops = &au1xxx_port_ops, | 523 | .port_ops = &au1xxx_port_ops, |
524 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | ||
525 | .dma_ops = &au1xxx_dma_ops, | ||
526 | #endif | ||
514 | .host_flags = IDE_HFLAG_POST_SET_MODE | | 527 | .host_flags = IDE_HFLAG_POST_SET_MODE | |
515 | IDE_HFLAG_NO_IO_32BIT | | 528 | IDE_HFLAG_NO_IO_32BIT | |
516 | IDE_HFLAG_UNMASK_IRQS, | 529 | IDE_HFLAG_UNMASK_IRQS, |
@@ -589,16 +602,6 @@ static int au_ide_probe(struct device *dev) | |||
589 | hwif->INSW = auide_insw; | 602 | hwif->INSW = auide_insw; |
590 | hwif->OUTSW = auide_outsw; | 603 | hwif->OUTSW = auide_outsw; |
591 | #endif | 604 | #endif |
592 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | ||
593 | hwif->dma_timeout = &auide_dma_timeout; | ||
594 | hwif->dma_host_set = &auide_dma_host_set; | ||
595 | hwif->dma_exec_cmd = &auide_dma_exec_cmd; | ||
596 | hwif->dma_start = &auide_dma_start; | ||
597 | hwif->ide_dma_end = &auide_dma_end; | ||
598 | hwif->dma_setup = &auide_dma_setup; | ||
599 | hwif->ide_dma_test_irq = &auide_dma_test_irq; | ||
600 | hwif->dma_lost_irq = &auide_dma_lost_irq; | ||
601 | #endif | ||
602 | hwif->select_data = 0; /* no chipset-specific code */ | 605 | hwif->select_data = 0; /* no chipset-specific code */ |
603 | hwif->config_data = 0; /* no chipset-specific code */ | 606 | hwif->config_data = 0; /* no chipset-specific code */ |
604 | 607 | ||