ide: add ide_set{_max}_pio() (take 4)
[deliverable/linux.git] / drivers / ide / legacy / dtc2278.c
index 3b1d33baaa2f6c08758081c7ac1331ad5e3c8e74..f165212548673729f412bbfb031aea67ba20c49c 100644 (file)
@@ -4,8 +4,6 @@
  *  Copyright (C) 1996  Linus Torvalds & author (see below)
  */
 
-#undef REALLY_SLOW_IO           /* most systems can safely undef this */
-
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
@@ -69,12 +67,10 @@ static void sub22 (char b, char c)
        }
 }
 
-static void tune_dtc2278 (ide_drive_t *drive, u8 pio)
+static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio)
 {
        unsigned long flags;
 
-       pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
-
        if (pio >= 3) {
                spin_lock_irqsave(&ide_lock, flags);
                /*
@@ -94,7 +90,7 @@ static void tune_dtc2278 (ide_drive_t *drive, u8 pio)
        HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1;
 }
 
-static int __init probe_dtc2278(void)
+static int __init dtc2278_probe(void)
 {
        unsigned long flags;
        ide_hwif_t *hwif, *mate;
@@ -125,7 +121,8 @@ static int __init probe_dtc2278(void)
 
        hwif->serialized = 1;
        hwif->chipset = ide_dtc2278;
-       hwif->tuneproc = &tune_dtc2278;
+       hwif->pio_mask = ATA_PIO4;
+       hwif->set_pio_mode = &dtc2278_set_pio_mode;
        hwif->drives[0].no_unmask = 1;
        hwif->drives[1].no_unmask = 1;
        hwif->mate = mate;
@@ -140,15 +137,24 @@ static int __init probe_dtc2278(void)
        probe_hwif_init(hwif);
        probe_hwif_init(mate);
 
-       create_proc_ide_interfaces();
+       ide_proc_register_port(hwif);
+       ide_proc_register_port(mate);
 
        return 0;
 }
 
+int probe_dtc2278 = 0;
+
+module_param_named(probe, probe_dtc2278, bool, 0);
+MODULE_PARM_DESC(probe, "probe for DTC2278xx chipsets");
+
 /* Can be called directly from ide.c. */
 int __init dtc2278_init(void)
 {
-       if (probe_dtc2278()) {
+       if (probe_dtc2278 == 0)
+               return -ENODEV;
+
+       if (dtc2278_probe()) {
                printk(KERN_ERR "dtc2278: ide interfaces already in use!\n");
                return -EBUSY;
        }
This page took 0.031026 seconds and 5 git commands to generate.