]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/pci/hpt34x.c
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[linux-2.6-omap-h63xx.git] / drivers / ide / pci / hpt34x.c
index 2e4591303f4feb945f2a7f385268d88e4b969477..a1bb10188fe54da2e84b190745b009083305aea7 100644 (file)
 
 #define HPT343_DEBUG_DRIVE_INFO                0
 
-static int hpt34x_tune_chipset (ide_drive_t *drive, u8 xferspeed)
+static int hpt34x_tune_chipset(ide_drive_t *drive, const u8 speed)
 {
        struct pci_dev *dev     = HWIF(drive)->pci_dev;
-       u8 speed = ide_rate_filter(drive, xferspeed);
        u32 reg1= 0, tmp1 = 0, reg2 = 0, tmp2 = 0;
        u8                      hi_speed, lo_speed;
 
@@ -78,9 +77,8 @@ static int hpt34x_tune_chipset (ide_drive_t *drive, u8 xferspeed)
        return(ide_config_drive_speed(drive, speed));
 }
 
-static void hpt34x_tune_drive (ide_drive_t *drive, u8 pio)
+static void hpt34x_set_pio_mode(ide_drive_t *drive, const u8 pio)
 {
-       pio = ide_get_best_pio_mode(drive, pio, 5);
        (void) hpt34x_tune_chipset(drive, (XFER_PIO_0 + pio));
 }
 
@@ -89,14 +87,10 @@ static int hpt34x_config_drive_xfer_rate (ide_drive_t *drive)
        drive->init_speed = 0;
 
        if (ide_tune_dma(drive))
-#ifndef CONFIG_HPT34X_AUTODMA
                return -1;
-#else
-               return 0;
-#endif
 
        if (ide_use_fast_pio(drive))
-               hpt34x_tune_drive(drive, 255);
+               ide_set_max_pio(drive);
 
        return -1;
 }
@@ -150,7 +144,7 @@ static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif)
 
        hwif->autodma = 0;
 
-       hwif->tuneproc = &hpt34x_tune_drive;
+       hwif->set_pio_mode = &hpt34x_set_pio_mode;
        hwif->speedproc = &hpt34x_tune_chipset;
        hwif->drives[0].autotune = 1;
        hwif->drives[1].autotune = 1;
@@ -160,9 +154,11 @@ static void __devinit init_hwif_hpt34x(ide_hwif_t *hwif)
        if (!hwif->dma_base)
                return;
 
+#ifdef CONFIG_HPT34X_AUTODMA
        hwif->ultra_mask = 0x07;
        hwif->mwdma_mask = 0x07;
        hwif->swdma_mask = 0x07;
+#endif
 
        hwif->ide_dma_check = &hpt34x_config_drive_xfer_rate;
        if (!noautodma)
@@ -177,7 +173,8 @@ static ide_pci_device_t hpt34x_chipset __devinitdata = {
        .init_hwif      = init_hwif_hpt34x,
        .autodma        = NOAUTODMA,
        .bootable       = NEVER_BOARD,
-       .extra          = 16
+       .extra          = 16,
+       .pio_mask       = ATA_PIO5,
 };
 
 static int __devinit hpt34x_init_one(struct pci_dev *dev, const struct pci_device_id *id)