]> err.no Git - linux-2.6/blobdiff - drivers/ide/legacy/ht6560b.c
Merge branch 'for-linus' of git://neil.brown.name/md
[linux-2.6] / drivers / ide / legacy / ht6560b.c
index 702d8deb578053033d4aa2deb610384b6876294b..7bc8fd59ea9ee336dbcab2a5981c0bf696df6401 100644 (file)
@@ -157,8 +157,8 @@ static void ht6560b_selectproc (ide_drive_t *drive)
                /*
                 * Set timing for this drive:
                 */
-               outb(timing, hwif->io_ports[IDE_SELECT_OFFSET]);
-               (void)inb(hwif->io_ports[IDE_STATUS_OFFSET]);
+               outb(timing, hwif->io_ports.device_addr);
+               (void)inb(hwif->io_ports.status_addr);
 #ifdef DEBUG
                printk("ht6560b: %s: select=%#x timing=%#x\n",
                        drive->name, select, timing);
@@ -212,10 +212,11 @@ static u8 ht_pio2timings(ide_drive_t *drive, const u8 pio)
 {
        int active_time, recovery_time;
        int active_cycles, recovery_cycles;
-       int bus_speed = system_bus_clock();
-       
+       int bus_speed = ide_vlb_clk ? ide_vlb_clk : 50;
+
         if (pio) {
                unsigned int cycle_time;
+               struct ide_timing *t = ide_timing_find_mode(XFER_PIO_0 + pio);
 
                cycle_time = ide_pio_cycle_time(drive, pio);
 
@@ -224,10 +225,8 @@ static u8 ht_pio2timings(ide_drive_t *drive, const u8 pio)
                 *  actual cycle time for recovery and activity
                 *  according system bus speed.
                 */
-               active_time = ide_pio_timings[pio].active_time;
-               recovery_time = cycle_time
-                       - active_time
-                       - ide_pio_timings[pio].setup_time;
+               active_time = t->active;
+               recovery_time = cycle_time - active_time - t->setup;
                /*
                 *  Cycle times should be Vesa bus cycles
                 */
@@ -311,25 +310,25 @@ static void ht6560b_set_pio_mode(ide_drive_t *drive, const u8 pio)
 #endif
 }
 
-static void __init ht6560b_port_init_devs(ide_hwif_t *hwif)
+static void __init ht6560b_init_dev(ide_drive_t *drive)
 {
+       ide_hwif_t *hwif = drive->hwif;
        /* Setting default configurations for drives. */
        int t = (HT_CONFIG_DEFAULT << 8) | HT_TIMING_DEFAULT;
 
        if (hwif->channel)
                t |= (HT_SECONDARY_IF << 8);
 
-       hwif->drives[0].drive_data = t;
-       hwif->drives[1].drive_data = t;
+       drive->drive_data = t;
 }
 
-int probe_ht6560b = 0;
+static int probe_ht6560b;
 
 module_param_named(probe, probe_ht6560b, bool, 0);
 MODULE_PARM_DESC(probe, "probe for HT6560B chipset");
 
 static const struct ide_port_ops ht6560b_port_ops = {
-       .port_init_devs         = ht6560b_port_init_devs,
+       .init_dev               = ht6560b_init_dev,
        .set_pio_mode           = ht6560b_set_pio_mode,
        .selectproc             = ht6560b_selectproc,
 };
@@ -340,7 +339,6 @@ static const struct ide_port_info ht6560b_port_info __initdata = {
        .port_ops               = &ht6560b_port_ops,
        .host_flags             = IDE_HFLAG_SERIALIZE | /* is this needed? */
                                  IDE_HFLAG_NO_DMA |
-                                 IDE_HFLAG_NO_AUTOTUNE |
                                  IDE_HFLAG_ABUSE_PREFETCH,
        .pio_mask               = ATA_PIO4,
 };