diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-02 13:56:31 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-02-02 13:56:31 -0500 |
commit | c413b9b94d9a8e7548cc4b2e04b7df0439ce76fd (patch) | |
tree | 5d23110a0d1f87ad0c88fb1746194e532808eaab /drivers/ide/mips/au1xxx-ide.c | |
parent | 1ebf74936b1fccb5b65940f99ccddd74ec4d1fef (diff) |
ide: add struct ide_port_info instances to legacy host drivers
* Remove 'struct pci_dev *dev' argument from ide_hwif_setup_dma().
* Un-static ide_hwif_setup_dma() and add CONFIG_BLK_DEV_IDEDMA_PCI=n version.
* Add 'const struct ide_port_info *d' argument to ide_device_add[_all]().
* Factor out generic ports init from ide_pci_setup_ports() to ide_init_port(),
move it to ide-probe.c and call it in in ide_device_add_all() instead of
ide_pci_setup_ports().
* Move ->mate setup to ide_device_add_all() from ide_port_init().
* Add IDE_HFLAG_NO_AUTOTUNE host flag for host drivers that don't enable
->autotune currently.
* Setup hwif->chipset in ide_init_port() but iff pi->chipset is set
(to not override setup done by ide_hwif_configure()).
* Add ETRAX host handling to ide_device_add_all().
* cmd640.c: set IDE_HFLAG_ABUSE_* also for CONFIG_BLK_DEV_CMD640_ENHANCED=n.
* pmac.c: make pmac_ide_setup_dma() return an error value and move DMA masks
setup to pmac_ide_setup_device().
* Add 'struct ide_port_info' instances to legacy host drivers, pass them to
ide_device_add() calls and then remove open-coded ports initialization.
Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/mips/au1xxx-ide.c')
-rw-r--r-- | drivers/ide/mips/au1xxx-ide.c | 31 |
1 files changed, 11 insertions, 20 deletions
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c index 6e98662b1192..b80d77a260da 100644 --- a/drivers/ide/mips/au1xxx-ide.c +++ b/drivers/ide/mips/au1xxx-ide.c | |||
@@ -548,6 +548,16 @@ static void auide_setup_ports(hw_regs_t *hw, _auide_hwif *ahwif) | |||
548 | *ata_regs = ahwif->regbase + (14 << AU1XXX_ATA_REG_OFFSET); | 548 | *ata_regs = ahwif->regbase + (14 << AU1XXX_ATA_REG_OFFSET); |
549 | } | 549 | } |
550 | 550 | ||
551 | static const struct ide_port_info au1xxx_port_info = { | ||
552 | .host_flags = IDE_HFLAG_POST_SET_MODE | | ||
553 | IDE_HFLAG_NO_DMA | /* no SFF-style DMA */ | ||
554 | IDE_HFLAG_UNMASK_IRQS, | ||
555 | .pio_mask = ATA_PIO4, | ||
556 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | ||
557 | .mwdma_mask = ATA_MWDMA2, | ||
558 | #endif | ||
559 | }; | ||
560 | |||
551 | static int au_ide_probe(struct device *dev) | 561 | static int au_ide_probe(struct device *dev) |
552 | { | 562 | { |
553 | struct platform_device *pdev = to_platform_device(dev); | 563 | struct platform_device *pdev = to_platform_device(dev); |
@@ -606,21 +616,6 @@ static int au_ide_probe(struct device *dev) | |||
606 | 616 | ||
607 | hwif->dev = dev; | 617 | hwif->dev = dev; |
608 | 618 | ||
609 | hwif->ultra_mask = 0x0; /* Disable Ultra DMA */ | ||
610 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | ||
611 | hwif->mwdma_mask = 0x07; /* Multimode-2 DMA */ | ||
612 | hwif->swdma_mask = 0x00; | ||
613 | #else | ||
614 | hwif->mwdma_mask = 0x0; | ||
615 | hwif->swdma_mask = 0x0; | ||
616 | #endif | ||
617 | |||
618 | hwif->pio_mask = ATA_PIO4; | ||
619 | hwif->host_flags = IDE_HFLAG_POST_SET_MODE; | ||
620 | |||
621 | hwif->drives[0].unmask = 1; | ||
622 | hwif->drives[1].unmask = 1; | ||
623 | |||
624 | /* hold should be on in all cases */ | 619 | /* hold should be on in all cases */ |
625 | hwif->hold = 1; | 620 | hwif->hold = 1; |
626 | 621 | ||
@@ -651,13 +646,9 @@ static int au_ide_probe(struct device *dev) | |||
651 | hwif->ide_dma_test_irq = &auide_dma_test_irq; | 646 | hwif->ide_dma_test_irq = &auide_dma_test_irq; |
652 | hwif->dma_lost_irq = &auide_dma_lost_irq; | 647 | hwif->dma_lost_irq = &auide_dma_lost_irq; |
653 | #endif | 648 | #endif |
654 | hwif->channel = 0; | ||
655 | hwif->select_data = 0; /* no chipset-specific code */ | 649 | hwif->select_data = 0; /* no chipset-specific code */ |
656 | hwif->config_data = 0; /* no chipset-specific code */ | 650 | hwif->config_data = 0; /* no chipset-specific code */ |
657 | 651 | ||
658 | hwif->drives[0].autotune = 1; /* 1=autotune, 2=noautotune, 0=default */ | ||
659 | hwif->drives[1].autotune = 1; | ||
660 | |||
661 | hwif->no_io_32bit = 1; | 652 | hwif->no_io_32bit = 1; |
662 | 653 | ||
663 | auide_hwif.hwif = hwif; | 654 | auide_hwif.hwif = hwif; |
@@ -670,7 +661,7 @@ static int au_ide_probe(struct device *dev) | |||
670 | 661 | ||
671 | idx[0] = hwif->index; | 662 | idx[0] = hwif->index; |
672 | 663 | ||
673 | ide_device_add(idx); | 664 | ide_device_add(idx, &au1xxx_port_info); |
674 | 665 | ||
675 | dev_set_drvdata(dev, hwif); | 666 | dev_set_drvdata(dev, hwif); |
676 | 667 | ||