/* If interrupt is delivered through GPIO, IRQ are triggered on falling and rising edge of signal. Whereas IDE device request interrupt on high level (rising edge in our case). This mean we have fake interrupts, so we need to check interrupt pin and exit instantly from ISR when line is on low level.  */
irqreturn_t at91_irq_handler(int irq, void *dev_id)
/* If interrupt is delivered through GPIO, IRQ are triggered on falling and rising edge of signal. Whereas IDE device request interrupt on high level (rising edge in our case). This mean we have fake interrupts, so we need to check interrupt pin and exit instantly from ISR when line is on low level.  */
irqreturn_t at91_irq_handler(int irq, void *dev_id)
{
	int ntries = 8;
	int pin_val1, pin_val2;
	do {
		pin_val1 = at91_get_gpio_value(irq);
		pin_val2 = at91_get_gpio_value(irq);
	} while (pin_val1 != pin_val2 && --ntries > 0);
	if (pin_val1 == 0 || ntries <= 0)
		return IRQ_HANDLED;
	return ide_intr(irq, dev_id);
}