]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/legacy/ht6560b.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[linux-2.6-omap-h63xx.git] / drivers / ide / legacy / ht6560b.c
index dd6dfb32e85303b4342be96afddddd4584cf33f4..98f7c95e39ed4fd0e9f89244b5cb7a2edbde6e4d 100644 (file)
@@ -3,34 +3,12 @@
  */
 
 /*
- *
- *  Version 0.01        Initial version hacked out of ide.c
- *
- *  Version 0.02        Added support for PIO modes, auto-tune
- *
- *  Version 0.03        Some cleanups
- *
- *  Version 0.05        PIO mode cycle timings auto-tune using bus-speed
- *
- *  Version 0.06        Prefetch mode now defaults no OFF. To set
- *                      prefetch mode OFF/ON use "hdparm -p8/-p9".
- *                      Unmask irq is disabled when prefetch mode
- *                      is enabled.
- *
- *  Version 0.07        Trying to fix CD-ROM detection problem.
- *                      "Prefetch" mode bit OFF for ide disks and
- *                      ON for anything else.
- *
- *  Version 0.08        Need to force prefetch for CDs and other non-disk
- *                      devices. (not sure which devices exactly need
- *                      prefetch)
- *
  *  HT-6560B EIDE-controller support
  *  To activate controller support use kernel parameter "ide0=ht6560b".
  *  Use hdparm utility to enable PIO mode support.
  *
  *  Author:    Mikko Ala-Fossi            <maf@iki.fi>
- *             Jan Evert van Grootheest   <janevert@caiway.nl>
+ *             Jan Evert van Grootheest   <j.e.van.grootheest@caiway.nl>
  *
  *  Try:  http://www.maf.iki.fi/~maf/ht6560b/
  */
@@ -216,6 +194,7 @@ static u8 ht_pio2timings(ide_drive_t *drive, const u8 pio)
 
         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 +203,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,16 +288,16 @@ 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;
 }
 
 static int probe_ht6560b;
@@ -329,7 +306,7 @@ 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,
 };