diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-20 00:32:30 +0200 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-10-20 00:32:30 +0200 |
commit | caea7602f309cbd55ba609800fd3c3e5d19ab684 (patch) | |
tree | fbf1fab750452317a1a38f9ec38b18ad6b1323c3 /drivers/ide/pci/via82cxxx.c | |
parent | 272a370900e5d2ae84662338397bb7b2375ff5cf (diff) |
ide: add IDE_HFLAG_{IO_32BIT,UNMASK_IRQS} host flags
Add IDE_HFLAG_{IO_32BIT,UNMASK_IRQS} host flag to tell ide_pci_setup_ports()
to set drive->{io_32bit,unmask} for both drives on the interface. Convert
amd74xx, sl82c105 and via82cxxx host drivers to use these new host flags.
While at it:
* Add IDE_HFLAGS_AMD define (amd74xx host driver).
* Add IDE_HFLAGS_VIA define (via82cxxx host driver).
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/via82cxxx.c')
-rw-r--r-- | drivers/ide/pci/via82cxxx.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c index 27e5b410123a..14979f4df362 100644 --- a/drivers/ide/pci/via82cxxx.c +++ b/drivers/ide/pci/via82cxxx.c @@ -422,17 +422,9 @@ static u8 __devinit via82cxxx_cable_detect(ide_hwif_t *hwif) static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) { - struct via82cxxx_dev *vdev = pci_get_drvdata(hwif->pci_dev); - int i; - hwif->set_pio_mode = &via_set_pio_mode; hwif->set_dma_mode = &via_set_drive; - for (i = 0; i < 2; i++) { - hwif->drives[i].io_32bit = 1; - hwif->drives[i].unmask = (vdev->via_config->flags & VIA_NO_UNMASK) ? 0 : 1; - } - if (!hwif->dma_base) return; @@ -440,17 +432,20 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) hwif->cbl = via82cxxx_cable_detect(hwif); } +#define IDE_HFLAGS_VIA \ + (IDE_HFLAG_PIO_NO_BLACKLIST | \ + IDE_HFLAG_PIO_NO_DOWNGRADE | \ + IDE_HFLAG_POST_SET_MODE | \ + IDE_HFLAG_IO_32BIT | \ + IDE_HFLAG_BOOTABLE) + static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = { { /* 0 */ .name = "VP_IDE", .init_chipset = init_chipset_via82cxxx, .init_hwif = init_hwif_via82cxxx, .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, - .host_flags = IDE_HFLAG_PIO_NO_BLACKLIST | - IDE_HFLAG_PIO_NO_DOWNGRADE | - IDE_HFLAG_POST_SET_MODE | - IDE_HFLAG_NO_AUTODMA | - IDE_HFLAG_BOOTABLE, + .host_flags = IDE_HFLAGS_VIA | IDE_HFLAG_NO_AUTODMA, .pio_mask = ATA_PIO5, .swdma_mask = ATA_SWDMA2, .mwdma_mask = ATA_MWDMA2, @@ -459,10 +454,7 @@ static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = { .init_chipset = init_chipset_via82cxxx, .init_hwif = init_hwif_via82cxxx, .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, - .host_flags = IDE_HFLAG_PIO_NO_BLACKLIST | - IDE_HFLAG_PIO_NO_DOWNGRADE | - IDE_HFLAG_POST_SET_MODE | - IDE_HFLAG_BOOTABLE, + .host_flags = IDE_HFLAGS_VIA, .pio_mask = ATA_PIO5, .swdma_mask = ATA_SWDMA2, .mwdma_mask = ATA_MWDMA2, @@ -485,6 +477,11 @@ static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_i return -ENODEV; } + if (via_config->flags & VIA_NO_UNMASK) + d->host_flags &= ~IDE_HFLAG_UNMASK_IRQS; + else + d->host_flags |= IDE_HFLAG_UNMASK_IRQS; + #ifdef CONFIG_PPC_CHRP if (machine_is(chrp) && _chrp_type == _CHRP_Pegasos) d->host_flags |= IDE_HFLAG_FORCE_LEGACY_IRQS; |