]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/pci/cs5535.c
Start split out of common open firmware code
[linux-2.6-omap-h63xx.git] / drivers / ide / pci / cs5535.c
index 41925c47ef05968d484107b34b7c22b1e53373c4..ce44e38390aa9e8bec5232ba1f9304f191dc6c07 100644 (file)
@@ -89,7 +89,7 @@ static void cs5535_set_speed(ide_drive_t *drive, u8 speed)
 
                pioa = speed - XFER_PIO_0;
                piob = ide_get_best_pio_mode(&(drive->hwif->drives[!unit]),
-                                               255, 4, NULL);
+                                               255, 4);
                cmd = pioa < piob ? pioa : piob;
 
                /* Write the speed of the current drive */
@@ -159,7 +159,7 @@ static void cs5535_tuneproc(ide_drive_t *drive, u8 xferspeed)
        /* cs5535 max pio is pio 4, best_pio will check the blacklist.
        i think we don't need to rate_filter the incoming xferspeed
        since we know we're only going to choose pio */
-       xferspeed = ide_get_best_pio_mode(drive, xferspeed, 4, NULL);
+       xferspeed = ide_get_best_pio_mode(drive, xferspeed, 4);
        ide_config_drive_speed(drive, modes[xferspeed]);
        cs5535_set_speed(drive, xferspeed);
 }
@@ -174,7 +174,7 @@ static int cs5535_dma_check(ide_drive_t *drive)
                return 0;
 
        if (ide_use_fast_pio(drive)) {
-               speed = ide_get_best_pio_mode(drive, 255, 4, NULL);
+               speed = ide_get_best_pio_mode(drive, 255, 4);
                cs5535_set_drive(drive, speed);
        }
 
@@ -187,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;
 }
 
 /****
@@ -212,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;
@@ -228,9 +228,10 @@ 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,
+       .pio_mask       = ATA_PIO4,
 };
 
 static int __devinit cs5535_init_one(struct pci_dev *dev,