]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/legacy/dtc2278.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
[linux-2.6-omap-h63xx.git] / drivers / ide / legacy / dtc2278.c
index 24a845d45bd29b369001979b9b24cede2c6bda05..9c6b3249a0045af80f0721fd4daf13db5498e248 100644 (file)
@@ -1,6 +1,4 @@
 /*
- *  linux/drivers/ide/legacy/dtc2278.c         Version 0.02    Feb 10, 1996
- *
  *  Copyright (C) 1996  Linus Torvalds & author (see below)
  */
 
@@ -86,25 +84,26 @@ static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio)
                /* Actually we do - there is a data sheet available for the
                   Winbond but does anyone actually care */
        }
-
-       /*
-        * 32bit I/O has to be enabled for *both* drives at the same time.
-        */
-       drive->io_32bit = 1;
-       HWIF(drive)->drives[!drive->select.b.unit].io_32bit = 1;
 }
 
+static const struct ide_port_info dtc2278_port_info __initdata = {
+       .chipset                = ide_dtc2278,
+       .host_flags             = IDE_HFLAG_SERIALIZE |
+                                 IDE_HFLAG_NO_UNMASK_IRQS |
+                                 IDE_HFLAG_IO_32BIT |
+                                 /* disallow ->io_32bit changes */
+                                 IDE_HFLAG_NO_IO_32BIT |
+                                 IDE_HFLAG_NO_DMA |
+                                 IDE_HFLAG_NO_AUTOTUNE,
+       .pio_mask               = ATA_PIO4,
+};
+
 static int __init dtc2278_probe(void)
 {
        unsigned long flags;
        ide_hwif_t *hwif, *mate;
-       static u8 idx[4] = { 0, 1, 0xff, 0xff };
-
-       hwif = &ide_hwifs[0];
-       mate = &ide_hwifs[1];
-
-       if (hwif->chipset != ide_unknown || mate->chipset != ide_unknown)
-               return 1;
+       static u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
+       hw_regs_t hw[2];
 
        local_irq_save(flags);
        /*
@@ -124,23 +123,28 @@ static int __init dtc2278_probe(void)
 #endif
        local_irq_restore(flags);
 
-       hwif->serialized = 1;
-       hwif->chipset = ide_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;
+       memset(&hw, 0, sizeof(hw));
 
-       mate->serialized = 1;
-       mate->chipset = ide_dtc2278;
-       mate->pio_mask = ATA_PIO4;
-       mate->drives[0].no_unmask = 1;
-       mate->drives[1].no_unmask = 1;
-       mate->mate = hwif;
-       mate->channel = 1;
+       ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
+       hw[0].irq = 14;
 
-       ide_device_add(idx);
+       ide_std_init_ports(&hw[1], 0x170, 0x376);
+       hw[1].irq = 15;
+
+       hwif = ide_find_port();
+       if (hwif) {
+               ide_init_port_hw(hwif, &hw[0]);
+               hwif->set_pio_mode = dtc2278_set_pio_mode;
+               idx[0] = hwif->index;
+       }
+
+       mate = ide_find_port();
+       if (mate) {
+               ide_init_port_hw(mate, &hw[1]);
+               idx[1] = mate->index;
+       }
+
+       ide_device_add(idx, &dtc2278_port_info);
 
        return 0;
 }
@@ -150,8 +154,7 @@ 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)
+static int __init dtc2278_init(void)
 {
        if (probe_dtc2278 == 0)
                return -ENODEV;
@@ -163,9 +166,7 @@ int __init dtc2278_init(void)
        return 0;
 }
 
-#ifdef MODULE
 module_init(dtc2278_init);
-#endif
 
 MODULE_AUTHOR("See Local File");
 MODULE_DESCRIPTION("support of DTC-2278 VLB IDE chipsets");