Just a few more questions. Once again, any and all help appreciated.

Heres my module at present:

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/irq.h>

int count = 0;

void irq_handler(int irq, void *dev_id, struct pt_regs *regs)
    count ++;
    printk("timer_isr: %d\n", count);

static int adc_timer_init( void )
    printk("ADC timer interrupt module loaded.\n");
    printk("Freeing IRQ_OST2..... ");
    free_irq(IRQ_OST2, NULL);
    // Not sure if I need this line so commented it out
    //set_irq_type(IRQ_OST2, IRQT_FALLING);
    if( 0 == request_irq(IRQ_OST2, irq_handler, 0, "timer_isr_handler", NULL) )
        printk("<1>IRQ_OST2 interrupt requested sucessfully.\n");
        printk("<1>IRQ_OST2 interrupt could not be obtained.\n");
    return 0;


static void adc_timer_exit( void )
    printk("Freeing IRQ_OST2..... ");
    free_irq(IRQ_OST2, NULL);
    printk("ADC timer module unloaded.\n");


MODULE_AUTHOR("Brendan Maguire");
MODULE_DESCRIPTION("ADC Timer Interrupt Module");

The relevent part of dmesg gives me:

ADC timer interrupt module loaded.
Freeing IRQ_OST2..... <3>Trying to free already-free IRQ 21
IRQ_OST2 interrupt requested sucessfully.
Freeing IRQ_OST2..... Done.
ADC timer module unloaded.

cat /proc/interrupts gives me:

  4:      10117          SC  pxa2xx_udc
 15:         74          SC  FFUART
 18:          0          SC  DMA
 19:     477676          SC  PXA Timer Tick
 21:          0          SC  timer_isr_handler
 27:          0        GPIO  CF0 nSTSCHG
 34:          0        GPIO  CF0 nCD
 58:          0        GPIO  pxa2xx_udc
Err:          0

So from what I can see above the module is loaded and is successful in requesting the OST2 interrupt. But is it never activated? This is what I read from /proc/interrupts. Do I have to enable it by writing directly to the relevant registers? Or is there some easy command like enable_irq(int IRQ)?

Also, if the timer interrupt handler was called would I see the timer_isr: count output in dmesg?

Hope someone can give me some guidance here.