/* This controller supports PIO0 to PIO2 (no IORDY even though higher timings can be loaded).  */
static void ht6560a_set_piomode(struct ata_port *ap, struct ata_device *adev)
/* This controller supports PIO0 to PIO2 (no IORDY even though higher timings can be loaded).  */
static void ht6560a_set_piomode(struct ata_port *ap, struct ata_device *adev)
{
	u8 active, recover;
	struct ata_timing t;
	ata_timing_compute(adev, adev->pio_mode, &t, 20000, 1000);
	active = clamp_val(t.active, 2, 15);
	recover = clamp_val(t.recover, 4, 15);
	inb(0x3E6);
	inb(0x3E6);
	inb(0x3E6);
	inb(0x3E6);
	iowrite8(recover << 4 | active, ap->ioaddr.device_addr);
	ioread8(ap->ioaddr.status_addr);
}