]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/legacy/ht6560b.c
triflex: always tune PIO
[linux-2.6-omap-h63xx.git] / drivers / ide / legacy / ht6560b.c
index c8f353b1296f9ca84c50bb8e1f127f2b2e3f3bd3..2e5a9cc5c0f7ab1a48a2b26bef35ca12922f4837 100644 (file)
@@ -199,23 +199,24 @@ static int __init try_to_init_ht6560b(void)
        return 1;
 }
 
-static u8 ht_pio2timings(ide_drive_t *drive, u8 pio)
+static u8 ht_pio2timings(ide_drive_t *drive, const u8 pio)
 {
        int active_time, recovery_time;
        int active_cycles, recovery_cycles;
-       ide_pio_data_t d;
        int bus_speed = system_bus_clock();
        
         if (pio) {
-               pio = ide_get_best_pio_mode(drive, pio, 5, &d);
-               
+               unsigned int cycle_time;
+
+               cycle_time = ide_pio_cycle_time(drive, pio);
+
                /*
                 *  Just like opti621.c we try to calculate the
                 *  actual cycle time for recovery and activity
                 *  according system bus speed.
                 */
                active_time = ide_pio_timings[pio].active_time;
-               recovery_time = d.cycle_time 
+               recovery_time = cycle_time
                        - active_time
                        - ide_pio_timings[pio].setup_time;
                /*
@@ -275,7 +276,7 @@ static void ht_set_prefetch(ide_drive_t *drive, u8 state)
 #endif
 }
 
-static void tune_ht6560b (ide_drive_t *drive, u8 pio)
+static void ht6560b_set_pio_mode(ide_drive_t *drive, const u8 pio)
 {
        unsigned long flags;
        u8 timing;
@@ -331,13 +332,17 @@ int __init ht6560b_init(void)
 
        hwif->chipset = ide_ht6560b;
        hwif->selectproc = &ht6560b_selectproc;
-       hwif->tuneproc = &tune_ht6560b;
+       hwif->host_flags = IDE_HFLAG_ABUSE_PREFETCH;
+       hwif->pio_mask = ATA_PIO5;
+       hwif->set_pio_mode = &ht6560b_set_pio_mode;
        hwif->serialized = 1;   /* is this needed? */
        hwif->mate = mate;
 
        mate->chipset = ide_ht6560b;
        mate->selectproc = &ht6560b_selectproc;
-       mate->tuneproc = &tune_ht6560b;
+       mate->host_flags = IDE_HFLAG_ABUSE_PREFETCH;
+       mate->pio_mask = ATA_PIO5;
+       mate->set_pio_mode = &ht6560b_set_pio_mode;
        mate->serialized = 1;   /* is this needed? */
        mate->mate = hwif;
        mate->channel = 1;