aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/via82cxxx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/via82cxxx.c')
-rw-r--r--drivers/ide/pci/via82cxxx.c31
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)
422 422
423static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif) 423static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
424{ 424{
425 struct via82cxxx_dev *vdev = pci_get_drvdata(hwif->pci_dev);
426 int i;
427
428 hwif->set_pio_mode = &via_set_pio_mode; 425 hwif->set_pio_mode = &via_set_pio_mode;
429 hwif->set_dma_mode = &via_set_drive; 426 hwif->set_dma_mode = &via_set_drive;
430 427
431 for (i = 0; i < 2; i++) {
432 hwif->drives[i].io_32bit = 1;
433 hwif->drives[i].unmask = (vdev->via_config->flags & VIA_NO_UNMASK) ? 0 : 1;
434 }
435
436 if (!hwif->dma_base) 428 if (!hwif->dma_base)
437 return; 429 return;
438 430
@@ -440,17 +432,20 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
440 hwif->cbl = via82cxxx_cable_detect(hwif); 432 hwif->cbl = via82cxxx_cable_detect(hwif);
441} 433}
442 434
435#define IDE_HFLAGS_VIA \
436 (IDE_HFLAG_PIO_NO_BLACKLIST | \
437 IDE_HFLAG_PIO_NO_DOWNGRADE | \
438 IDE_HFLAG_POST_SET_MODE | \
439 IDE_HFLAG_IO_32BIT | \
440 IDE_HFLAG_BOOTABLE)
441
443static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = { 442static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = {
444 { /* 0 */ 443 { /* 0 */
445 .name = "VP_IDE", 444 .name = "VP_IDE",
446 .init_chipset = init_chipset_via82cxxx, 445 .init_chipset = init_chipset_via82cxxx,
447 .init_hwif = init_hwif_via82cxxx, 446 .init_hwif = init_hwif_via82cxxx,
448 .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, 447 .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}},
449 .host_flags = IDE_HFLAG_PIO_NO_BLACKLIST | 448 .host_flags = IDE_HFLAGS_VIA | IDE_HFLAG_NO_AUTODMA,
450 IDE_HFLAG_PIO_NO_DOWNGRADE |
451 IDE_HFLAG_POST_SET_MODE |
452 IDE_HFLAG_NO_AUTODMA |
453 IDE_HFLAG_BOOTABLE,
454 .pio_mask = ATA_PIO5, 449 .pio_mask = ATA_PIO5,
455 .swdma_mask = ATA_SWDMA2, 450 .swdma_mask = ATA_SWDMA2,
456 .mwdma_mask = ATA_MWDMA2, 451 .mwdma_mask = ATA_MWDMA2,
@@ -459,10 +454,7 @@ static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = {
459 .init_chipset = init_chipset_via82cxxx, 454 .init_chipset = init_chipset_via82cxxx,
460 .init_hwif = init_hwif_via82cxxx, 455 .init_hwif = init_hwif_via82cxxx,
461 .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, 456 .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
462 .host_flags = IDE_HFLAG_PIO_NO_BLACKLIST | 457 .host_flags = IDE_HFLAGS_VIA,
463 IDE_HFLAG_PIO_NO_DOWNGRADE |
464 IDE_HFLAG_POST_SET_MODE |
465 IDE_HFLAG_BOOTABLE,
466 .pio_mask = ATA_PIO5, 458 .pio_mask = ATA_PIO5,
467 .swdma_mask = ATA_SWDMA2, 459 .swdma_mask = ATA_SWDMA2,
468 .mwdma_mask = ATA_MWDMA2, 460 .mwdma_mask = ATA_MWDMA2,
@@ -485,6 +477,11 @@ static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_i
485 return -ENODEV; 477 return -ENODEV;
486 } 478 }
487 479
480 if (via_config->flags & VIA_NO_UNMASK)
481 d->host_flags &= ~IDE_HFLAG_UNMASK_IRQS;
482 else
483 d->host_flags |= IDE_HFLAG_UNMASK_IRQS;
484
488#ifdef CONFIG_PPC_CHRP 485#ifdef CONFIG_PPC_CHRP
489 if (machine_is(chrp) && _chrp_type == _CHRP_Pegasos) 486 if (machine_is(chrp) && _chrp_type == _CHRP_Pegasos)
490 d->host_flags |= IDE_HFLAG_FORCE_LEGACY_IRQS; 487 d->host_flags |= IDE_HFLAG_FORCE_LEGACY_IRQS;