static irqreturn_t gptimer_example_irq(int irq, void *dev_id) { struct gptimer_data *data = dev_id; if (!get_gptimer_intr(TIMER5_id)) return IRQ_NONE; data->width = get_gptimer_pwidth(TIMER5_id); data->period = get_gptimer_period(TIMER5_id); clear_gptimer_intr(TIMER5_id); return IRQ_HANDLED; }
static irqreturn_t gptimer_example_irq(int irq, void *dev_id) { struct gptimer_data *data = dev_id; /* make sure it was our timer which caused the interrupt */ if (!get_gptimer_intr(TIMER5_id)) return IRQ_NONE; /* read the width/period values that were captured for the waveform */ data->width = get_gptimer_pwidth(TIMER5_id); data->period = get_gptimer_period(TIMER5_id); /* acknowledge the interrupt */ clear_gptimer_intr(TIMER5_id); /* tell the upper layers we took care of things */ return IRQ_HANDLED; }