]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/pci/opti621.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh64-2.6
[linux-2.6-omap-h63xx.git] / drivers / ide / pci / opti621.c
index 2437aed73f35be1fcd2ba9a354a80582a4e8090c..8953d9c3926fe3ea909563562374f3599d9568e6 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  linux/drivers/ide/pci/opti621.c            Version 0.7     Sept 10, 2002
+ *  linux/drivers/ide/pci/opti621.c            Version 0.9     Sep 24, 2007
  *
  *  Copyright (C) 1996-1998  Linus Torvalds & authors (see below)
  */
@@ -57,9 +57,6 @@
  * There is a 25/33MHz switch in configuration
  * register, but driver is written for use at any frequency which get
  * (use idebus=xx to select PCI bus speed).
- * Use hda=autotune and hdb=autotune for automatical tune of the PIO modes.
- * If you get strange results, do not use this and set PIO manually
- * by hdparm.
  *
  * Version 0.1, Nov 8, 1996
  * by Jaromir Koutek, for 2.1.8. 
@@ -136,6 +133,8 @@ static int reg_base;
 #define PIO_NOT_EXIST 254
 #define PIO_DONT_KNOW 255
 
+static DEFINE_SPINLOCK(opti621_lock);
+
 /* there are stored pio numbers from other calls of opti621_set_pio_mode */
 static void compute_pios(ide_drive_t *drive, const u8 pio)
 /* Store values into drive->drive_data
@@ -281,7 +280,7 @@ static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio)
                second.recovery_time, drdy);
 #endif
 
-       spin_lock_irqsave(&ide_lock, flags);
+       spin_lock_irqsave(&opti621_lock, flags);
 
        reg_base = hwif->io_ports[IDE_DATA_OFFSET];
 
@@ -320,7 +319,7 @@ static void opti621_set_pio_mode(ide_drive_t *drive, const u8 pio)
        /*  and read prefetch for both drives */
        write_reg(misc, MISC_REG);
 
-       spin_unlock_irqrestore(&ide_lock, flags);
+       spin_unlock_irqrestore(&opti621_lock, flags);
 }
 
 /*
@@ -332,31 +331,27 @@ static void __devinit init_hwif_opti621 (ide_hwif_t *hwif)
        hwif->drives[1].drive_data = PIO_DONT_KNOW;
 
        hwif->set_pio_mode = &opti621_set_pio_mode;
-
-       if (!(hwif->dma_base))
-               return;
-
-       hwif->mwdma_mask = 0x07;
-       hwif->swdma_mask = 0x07;
 }
 
-static ide_pci_device_t opti621_chipsets[] __devinitdata = {
+static const struct ide_port_info opti621_chipsets[] __devinitdata = {
        {       /* 0 */
                .name           = "OPTI621",
                .init_hwif      = init_hwif_opti621,
-               .autodma        = AUTODMA,
                .enablebits     = {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
-               .bootable       = ON_BOARD,
+               .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
+                                 IDE_HFLAG_BOOTABLE,
                .pio_mask       = ATA_PIO3,
-               .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA,
+               .swdma_mask     = ATA_SWDMA2,
+               .mwdma_mask     = ATA_MWDMA2,
        },{     /* 1 */
                .name           = "OPTI621X",
                .init_hwif      = init_hwif_opti621,
-               .autodma        = AUTODMA,
                .enablebits     = {{0x45,0x80,0x00}, {0x40,0x08,0x00}},
-               .bootable       = ON_BOARD,
+               .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA |
+                                 IDE_HFLAG_BOOTABLE,
                .pio_mask       = ATA_PIO3,
-               .host_flags     = IDE_HFLAG_TRUST_BIOS_FOR_DMA,
+               .swdma_mask     = ATA_SWDMA2,
+               .mwdma_mask     = ATA_MWDMA2,
        }
 };