]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/pci/cs5535.c
ide: add ide_pio_cycle_time() helper (take 2)
[linux-2.6-omap-h63xx.git] / drivers / ide / pci / cs5535.c
index 66a101e470d01d5af0a78c8a54e39a5f9d8c558a..5039793721446b3190ec8230082fe11fd70e9ea3 100644 (file)
@@ -164,26 +164,13 @@ static void cs5535_tuneproc(ide_drive_t *drive, u8 xferspeed)
        cs5535_set_speed(drive, xferspeed);
 }
 
-static int cs5535_config_drive_for_dma(ide_drive_t *drive)
-{
-       u8 speed = ide_max_dma_mode(drive);
-
-       /* If no DMA speed was available then let dma_check hit pio */
-       if (!speed) {
-               return 0;
-       }
-
-       cs5535_set_drive(drive, speed);
-       return ide_dma_enable(drive);
-}
-
 static int cs5535_dma_check(ide_drive_t *drive)
 {
        u8 speed;
 
        drive->init_speed = 0;
 
-       if (ide_use_dma(drive) && cs5535_config_drive_for_dma(drive))
+       if (ide_tune_dma(drive))
                return 0;
 
        if (ide_use_fast_pio(drive)) {
@@ -200,7 +187,8 @@ static u8 __devinit cs5535_cable_detect(struct pci_dev *dev)
 
        /* if a 80 wire cable was detected */
        pci_read_config_byte(dev, CS5535_CABLE_DETECT, &bit);
-       return (bit & 1);
+
+       return (bit & 1) ? ATA_CBL_PATA80 : ATA_CBL_PATA40;
 }
 
 /****
@@ -225,8 +213,7 @@ static void __devinit init_hwif_cs5535(ide_hwif_t *hwif)
        hwif->ultra_mask = 0x1F;
        hwif->mwdma_mask = 0x07;
 
-
-       hwif->udma_four = cs5535_cable_detect(hwif->pci_dev);
+       hwif->cbl = cs5535_cable_detect(hwif->pci_dev);
 
        if (!noautodma)
                hwif->autodma = 1;
@@ -241,9 +228,9 @@ static void __devinit init_hwif_cs5535(ide_hwif_t *hwif)
 static ide_pci_device_t cs5535_chipset __devinitdata = {
        .name           = "CS5535",
        .init_hwif      = init_hwif_cs5535,
-       .channels       = 1,
        .autodma        = AUTODMA,
        .bootable       = ON_BOARD,
+       .host_flags     = IDE_HFLAG_SINGLE,
 };
 
 static int __devinit cs5535_init_one(struct pci_dev *dev,