/* computes the timing value where lower nibble represents active time, in count of VLB clocks upper nibble represents recovery time, in count of VLB clocks  */
static u8 qd6500_compute_timing(ide_hwif_t *hwif, int active_time, int recovery_time)
/* computes the timing value where lower nibble represents active time, in count of VLB clocks upper nibble represents recovery time, in count of VLB clocks  */
static u8 qd6500_compute_timing(ide_hwif_t *hwif, int active_time, int recovery_time)
{
	int clk = ide_vlb_clk ? ide_vlb_clk : 50;
	u8 act_cyc, rec_cyc;
	if (clk <= 33) {
		act_cyc =  9 - IDE_IN(active_time   * clk / 1000 + 1, 2,  9);
		rec_cyc = 15 - IDE_IN(recovery_time * clk / 1000 + 1, 0, 15);
	} else {
		act_cyc =  8 - IDE_IN(active_time   * clk / 1000 + 1, 1,  8);
		rec_cyc = 18 - IDE_IN(recovery_time * clk / 1000 + 1, 3, 18);
	}
	return (rec_cyc << 4) | 0x08 | act_cyc;
}