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/cris/ide-cris.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/cris/ide-cris.c')
-rw-r--r-- | drivers/ide/cris/ide-cris.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/ide/cris/ide-cris.c b/drivers/ide/cris/ide-cris.c index 0640a38ff127..ac645263fd09 100644 --- a/drivers/ide/cris/ide-cris.c +++ b/drivers/ide/cris/ide-cris.c | |||
@@ -753,6 +753,15 @@ static void cris_set_dma_mode(ide_drive_t *drive, const u8 speed) | |||
753 | cris_ide_set_speed(TYPE_DMA, 0, strobe, hold); | 753 | cris_ide_set_speed(TYPE_DMA, 0, strobe, hold); |
754 | } | 754 | } |
755 | 755 | ||
756 | static const struct ide_port_info cris_port_info __initdata = { | ||
757 | .chipset = ide_etrax100, | ||
758 | .host_flags = IDE_HFLAG_NO_ATAPI_DMA | | ||
759 | IDE_HFLAG_NO_DMA, /* no SFF-style DMA */ | ||
760 | .pio_mask = ATA_PIO4, | ||
761 | .udma_mask = cris_ultra_mask, | ||
762 | .mwdma_mask = ATA_MWDMA2, | ||
763 | }; | ||
764 | |||
756 | static int __init init_e100_ide(void) | 765 | static int __init init_e100_ide(void) |
757 | { | 766 | { |
758 | hw_regs_t hw; | 767 | hw_regs_t hw; |
@@ -780,7 +789,6 @@ static int __init init_e100_ide(void) | |||
780 | ide_init_port_data(hwif, hwif->index); | 789 | ide_init_port_data(hwif, hwif->index); |
781 | ide_init_port_hw(hwif, &hw); | 790 | ide_init_port_hw(hwif, &hw); |
782 | hwif->mmio = 1; | 791 | hwif->mmio = 1; |
783 | hwif->chipset = ide_etrax100; | ||
784 | hwif->set_pio_mode = &cris_set_pio_mode; | 792 | hwif->set_pio_mode = &cris_set_pio_mode; |
785 | hwif->set_dma_mode = &cris_set_dma_mode; | 793 | hwif->set_dma_mode = &cris_set_dma_mode; |
786 | hwif->ata_input_data = &cris_ide_input_data; | 794 | hwif->ata_input_data = &cris_ide_input_data; |
@@ -799,12 +807,6 @@ static int __init init_e100_ide(void) | |||
799 | hwif->INB = &cris_ide_inb; | 807 | hwif->INB = &cris_ide_inb; |
800 | hwif->INW = &cris_ide_inw; | 808 | hwif->INW = &cris_ide_inw; |
801 | hwif->cbl = ATA_CBL_PATA40; | 809 | hwif->cbl = ATA_CBL_PATA40; |
802 | hwif->host_flags |= IDE_HFLAG_NO_ATAPI_DMA; | ||
803 | hwif->pio_mask = ATA_PIO4, | ||
804 | hwif->drives[0].autotune = 1; | ||
805 | hwif->drives[1].autotune = 1; | ||
806 | hwif->ultra_mask = cris_ultra_mask; | ||
807 | hwif->mwdma_mask = 0x07; /* Multiword DMA 0-2 */ | ||
808 | 810 | ||
809 | idx[h] = hwif->index; | 811 | idx[h] = hwif->index; |
810 | } | 812 | } |
@@ -820,7 +822,7 @@ static int __init init_e100_ide(void) | |||
820 | cris_ide_set_speed(TYPE_DMA, 0, ATA_DMA2_STROBE, ATA_DMA2_HOLD); | 822 | cris_ide_set_speed(TYPE_DMA, 0, ATA_DMA2_STROBE, ATA_DMA2_HOLD); |
821 | cris_ide_set_speed(TYPE_UDMA, ATA_UDMA2_CYC, ATA_UDMA2_DVS, 0); | 823 | cris_ide_set_speed(TYPE_UDMA, ATA_UDMA2_CYC, ATA_UDMA2_DVS, 0); |
822 | 824 | ||
823 | ide_device_add(idx); | 825 | ide_device_add(idx, &cris_port_info); |
824 | 826 | ||
825 | return 0; | 827 | return 0; |
826 | } | 828 | } |