ide: add short cables support
[safe/jmp/linux-2.6] / drivers / ide / pci / it8213.c
index 02b56cb..ff48c23 100644 (file)
@@ -197,25 +197,6 @@ static int it8213_tune_chipset (ide_drive_t *drive, u8 xferspeed)
        return ide_config_drive_speed(drive, speed);
 }
 
-/*
- *     config_chipset_for_dma  -       configure for DMA
- *     @drive: drive to configure
- *
- *     Called by the IDE layer when it wants the timings set up.
- */
-
-static int config_chipset_for_dma (ide_drive_t *drive)
-{
-       u8 speed = ide_max_dma_mode(drive);
-
-       if (!speed)
-               return 0;
-
-       it8213_tune_chipset(drive, speed);
-
-       return ide_dma_enable(drive);
-}
-
 /**
  *     it8213_configure_drive_for_dma  -       set up for DMA transfers
  *     @drive: drive we are going to set up
@@ -230,7 +211,7 @@ static int it8213_config_drive_for_dma (ide_drive_t *drive)
 {
        u8 pio;
 
-       if (ide_use_dma(drive) && config_chipset_for_dma(drive))
+       if (ide_tune_dma(drive))
                return 0;
 
        pio = ide_get_best_pio_mode(drive, 255, 4, NULL);
@@ -250,7 +231,7 @@ static int it8213_config_drive_for_dma (ide_drive_t *drive)
 
 static void __devinit init_hwif_it8213(ide_hwif_t *hwif)
 {
-       u8 reg42h = 0, ata66 = 0;
+       u8 reg42h = 0;
 
        hwif->speedproc = &it8213_tune_chipset;
        hwif->tuneproc  = &it8213_tuneproc;
@@ -269,11 +250,11 @@ static void __devinit init_hwif_it8213(ide_hwif_t *hwif)
        hwif->swdma_mask = 0x04;
 
        pci_read_config_byte(hwif->pci_dev, 0x42, &reg42h);
-       ata66 = (reg42h & 0x02) ? 0 : 1;
 
        hwif->ide_dma_check = &it8213_config_drive_for_dma;
-       if (!(hwif->udma_four))
-               hwif->udma_four = ata66;
+
+       if (hwif->cbl != ATA_CBL_PATA40_SHORT)
+               hwif->cbl = (reg42h & 0x02) ? ATA_CBL_PATA40 : ATA_CBL_PATA80;
 
        /*
         *      The BIOS often doesn't set up DMA on this controller