/* The IT821x has a single timing register for MWDMA and for PIO operations. As we flip back and forth we have to reload the clock.  */
static int it821x_dma_end(ide_drive_t *drive)
/* The IT821x has a single timing register for MWDMA and for PIO operations. As we flip back and forth we have to reload the clock.  */
static int it821x_dma_end(ide_drive_t *drive)
{
	ide_hwif_t *hwif = drive->hwif;
	struct it821x_dev *itdev = ide_get_hwifdata(hwif);
	int ret = ide_dma_end(drive);
	u8 unit = drive->dn & 1;
	if(itdev->mwdma[unit] != MWDMA_OFF)
		it821x_program(drive, itdev->pio[unit]);
	return ret;
}