/* * Simple gptimers example * http://docs.blackfin.uclinux.org/doku.php?id=linux-kernel:drivers:gptimers * * Copyright 2007-2009 Analog Devices Inc. * * Licensed under the GPL-2 or later. */ #include <linux/interrupt.h> #include <linux/module.h> #include <asm/gptimers.h> #include <asm/portmux.h> /* ... random driver includes ... */ #define DRIVER_NAME "gptimer_example" #ifdef IRQ_TIMER5 #define SAMPLE_IRQ_TIMER IRQ_TIMER5 #else #define SAMPLE_IRQ_TIMER IRQ_TIMER2 #endif struct gptimer_data { uint32_t period, width; }; static struct gptimer_data data; /* ... random driver state ... */
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; }Contributors
Person | Tokens | Prop | Commits | CommitProp |
Mike Frysinger | 61 | 100.00% | 1 | 100.00% |
Total | 61 | 100.00% | 1 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Mike Frysinger | 95 | 98.96% | 1 | 50.00% |
Chen Gang | 1 | 1.04% | 1 | 50.00% |
Total | 96 | 100.00% | 2 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Mike Frysinger | 26 | 96.30% | 1 | 50.00% |
Chen Gang | 1 | 3.70% | 1 | 50.00% |
Total | 27 | 100.00% | 2 | 100.00% |
Person | Tokens | Prop | Commits | CommitProp |
Mike Frysinger | 232 | 93.17% | 1 | 50.00% |
Chen Gang | 17 | 6.83% | 1 | 50.00% |
Total | 249 | 100.00% | 2 | 100.00% |