* This routine only knows how to look for drive units 0 and 1
  * on an interface, so any setting of MAX_DRIVES > 2 won't work here.
  */
-static void probe_hwif(ide_hwif_t *hwif)
+static void probe_hwif(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
 {
        unsigned int unit;
        unsigned long flags;
                return;
        }
 
+       if (fixup)
+               fixup(hwif);
+
        for (unit = 0; unit < MAX_DRIVES; ++unit) {
                ide_drive_t *drive = &hwif->drives[unit];
 
 
 int probe_hwif_init_with_fixup(ide_hwif_t *hwif, void (*fixup)(ide_hwif_t *hwif))
 {
-       probe_hwif(hwif);
-
-       if (fixup)
-               fixup(hwif);
+       probe_hwif(hwif, fixup);
 
        if (!hwif_init(hwif)) {
                printk(KERN_INFO "%s: failed to initialize IDE interface\n",
 
        for (index = 0; index < MAX_HWIFS; ++index)
                if (probe[index])
-                       probe_hwif(&ide_hwifs[index]);
+                       probe_hwif(&ide_hwifs[index], NULL);
        for (index = 0; index < MAX_HWIFS; ++index)
                if (probe[index])
                        hwif_init(&ide_hwifs[index]);
 
 
 /*
- * linux/drivers/ide/pci/it821x.c              Version 0.10    Mar 10 2007
+ * linux/drivers/ide/pci/it821x.c              Version 0.15    Jun 2 2007
  *
  * Copyright (C) 2004          Red Hat <alan@redhat.com>
  * Copyright (C) 2007          Bartlomiej Zolnierkiewicz
        }
 
        if (itdev->smart)
-               goto set_drive_speed;
+               return 0;
 
        /* We prefer 66Mhz clock for PIO 0-3, don't care for PIO4 */
        itdev->want[unit][1] = pio_want[set_pio];
        it821x_clock_strategy(drive);
        it821x_program(drive, itdev->pio[unit]);
 
-set_drive_speed:
        return ide_config_drive_speed(drive, XFER_PIO_0 + set_pio);
 }
 
                        default:
                                return 1;
                }
+
+               return ide_config_drive_speed(drive, speed);
        }
-       /*
-        *      In smart mode the clocking is done by the host controller
-        *      snooping the mode we picked. The rest of it is not our problem
-        */
-       return ide_config_drive_speed(drive, speed);
+
+       /* don't touch anything in the smart mode */
+       return 0;
 }
 
 /**
                                if(idbits[129] != 1)
                                        printk("(%dK stripe)", idbits[146]);
                                printk(".\n");
-                       /* Now the core code will have wrongly decided no DMA
-                          so we need to fix this */
-                       hwif->dma_off_quietly(drive);
-#ifdef CONFIG_IDEDMA_ONLYDISK
-                       if (drive->media == ide_disk)
-#endif
-                               ide_set_dma(drive);
                } else {
                        /* Non RAID volume. Fixups to stop the core code
                           doing unsupported things */
-                       id->field_valid &= 1;
+                       id->field_valid &= 3;
                        id->queue_depth = 0;
                        id->command_set_1 = 0;
                        id->command_set_2 &= 0xC400;
                        printk(KERN_INFO "%s: Performing identify fixups.\n",
                                drive->name);
                }
+
+               /*
+                * Set MWDMA0 mode as enabled/support - just to tell
+                * IDE core that DMA is supported (it821x hardware
+                * takes care of DMA mode programming).
+                */
+               if (id->capability & 1) {
+                       id->dma_mword |= 0x0101;
+                       drive->current_speed = XFER_MW_DMA_0;
+               }
        }
 
 }