aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/via82cxxx.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:33 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-19 18:32:33 -0400
commit6157332edabdf77ccae2a033b53bbc9ae1d70ede (patch)
treeb323381ceaf9a143ed61b153fd4f932d46846352 /drivers/ide/pci/via82cxxx.c
parent691da768a36584bd93ccaca248b261588c44f2da (diff)
via82cxxx: keep local ide_pci_device_t copy
* Keep local ide_pci_device_t copy in via_init_one(). * Adjust ide_pci_device_t copy according to id->driver_data in via_init_one() and remove no longer needed second via82cxxx_chipsets[] entry. * via82cxxx_chipsets[] -> via82cxxx_chipset. * Remove IDE_HFLAGS_VIA define. * Bump driver version. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/via82cxxx.c')
-rw-r--r--drivers/ide/pci/via82cxxx.c62
1 files changed, 27 insertions, 35 deletions
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
index 14979f4df362..0860b90f1550 100644
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * 2 *
3 * Version 3.49 3 * Version 3.50
4 * 4 *
5 * VIA IDE driver for Linux. Supported southbridges: 5 * VIA IDE driver for Linux. Supported southbridges:
6 * 6 *
@@ -432,40 +432,29 @@ static void __devinit init_hwif_via82cxxx(ide_hwif_t *hwif)
432 hwif->cbl = via82cxxx_cable_detect(hwif); 432 hwif->cbl = via82cxxx_cable_detect(hwif);
433} 433}
434 434
435#define IDE_HFLAGS_VIA \ 435static ide_pci_device_t via82cxxx_chipset __devinitdata = {
436 (IDE_HFLAG_PIO_NO_BLACKLIST | \ 436 .name = "VP_IDE",
437 IDE_HFLAG_PIO_NO_DOWNGRADE | \ 437 .init_chipset = init_chipset_via82cxxx,
438 IDE_HFLAG_POST_SET_MODE | \ 438 .init_hwif = init_hwif_via82cxxx,
439 IDE_HFLAG_IO_32BIT | \ 439 .enablebits = { { 0x40, 0x02, 0x02 }, { 0x40, 0x01, 0x01 } },
440 IDE_HFLAG_BOOTABLE) 440 .host_flags = IDE_HFLAG_PIO_NO_BLACKLIST |
441 441 IDE_HFLAG_PIO_NO_DOWNGRADE |
442static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = { 442 IDE_HFLAG_POST_SET_MODE |
443 { /* 0 */ 443 IDE_HFLAG_IO_32BIT |
444 .name = "VP_IDE", 444 IDE_HFLAG_BOOTABLE,
445 .init_chipset = init_chipset_via82cxxx, 445 .pio_mask = ATA_PIO5,
446 .init_hwif = init_hwif_via82cxxx, 446 .swdma_mask = ATA_SWDMA2,
447 .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, 447 .mwdma_mask = ATA_MWDMA2,
448 .host_flags = IDE_HFLAGS_VIA | IDE_HFLAG_NO_AUTODMA,
449 .pio_mask = ATA_PIO5,
450 .swdma_mask = ATA_SWDMA2,
451 .mwdma_mask = ATA_MWDMA2,
452 },{ /* 1 */
453 .name = "VP_IDE",
454 .init_chipset = init_chipset_via82cxxx,
455 .init_hwif = init_hwif_via82cxxx,
456 .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}},
457 .host_flags = IDE_HFLAGS_VIA,
458 .pio_mask = ATA_PIO5,
459 .swdma_mask = ATA_SWDMA2,
460 .mwdma_mask = ATA_MWDMA2,
461 }
462}; 448};
463 449
464static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_id *id) 450static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_id *id)
465{ 451{
466 ide_pci_device_t *d = &via82cxxx_chipsets[id->driver_data];
467 struct pci_dev *isa = NULL; 452 struct pci_dev *isa = NULL;
468 struct via_isa_bridge *via_config; 453 struct via_isa_bridge *via_config;
454 u8 idx = id->driver_data;
455 ide_pci_device_t d;
456
457 d = via82cxxx_chipset;
469 458
470 /* 459 /*
471 * Find the ISA bridge and check we know what it is. 460 * Find the ISA bridge and check we know what it is.
@@ -477,19 +466,22 @@ static int __devinit via_init_one(struct pci_dev *dev, const struct pci_device_i
477 return -ENODEV; 466 return -ENODEV;
478 } 467 }
479 468
480 if (via_config->flags & VIA_NO_UNMASK) 469 if (idx == 0)
481 d->host_flags &= ~IDE_HFLAG_UNMASK_IRQS; 470 d.host_flags |= IDE_HFLAG_NO_AUTODMA;
482 else 471 else
483 d->host_flags |= IDE_HFLAG_UNMASK_IRQS; 472 d.enablebits[1].reg = d.enablebits[0].reg = 0;
473
474 if ((via_config->flags & VIA_NO_UNMASK) == 0)
475 d.host_flags |= IDE_HFLAG_UNMASK_IRQS;
484 476
485#ifdef CONFIG_PPC_CHRP 477#ifdef CONFIG_PPC_CHRP
486 if (machine_is(chrp) && _chrp_type == _CHRP_Pegasos) 478 if (machine_is(chrp) && _chrp_type == _CHRP_Pegasos)
487 d->host_flags |= IDE_HFLAG_FORCE_LEGACY_IRQS; 479 d.host_flags |= IDE_HFLAG_FORCE_LEGACY_IRQS;
488#endif 480#endif
489 481
490 d->udma_mask = via_config->udma_mask; 482 d.udma_mask = via_config->udma_mask;
491 483
492 return ide_setup_pci_device(dev, d); 484 return ide_setup_pci_device(dev, &d);
493} 485}
494 486
495static const struct pci_device_id via_pci_tbl[] = { 487static const struct pci_device_id via_pci_tbl[] = {