Not sure if this would cause it but, when you ran it did you pass the gpio=<pin#> parameter?

Andy

On Nov 23, 2005, at 1:35 PM, Brian Gregory wrote:

I found code for gpio_irq.c on the mailing list and canít seem to get it to work.

insmod: cannot insert `./gpio_irq.ko': Unknown symbol in module (-1): No such file or directory

Any ideas what Iím doing wrong?

/*

†* gpio_irq.c - GPIO IRQ driver

†* writes to /var/log/messages timestamp when event occurs.

†*†

†* pass module parameter gpio to indicate which pin #

†* >>>> insmod gpio_irq.ko gpio=62

†*

†* Andy Triboletti 11/07/2005

†*

†*/††††††††††††††††††††††††† ††††††††††††††††††††††††††

#include <linux/init.h>

#include <linux/module.h>

#include <linux/kernel.h>

#include <linux/interrupt.h>

#include <asm/arch/pxa-regs.h>

#include <asm/irq.h>

#include <asm/arch-pxa/irqs.h>

#include <asm/arch-pxa/hardware.h>

#include <linux/time.h>

MODULE_LICENSE("Dual BSD/GPL");

int gpio = 0; // if not set

// get input (gpio as int) from the insmod command

MODULE_PARM(gpio, "i");

//this handler function gets called everytime an irq request happens

static irqreturn_t my_handler(int irq, void *dev_id, struct pt_regs *regs){

† struct timeval timecount;

† do_gettimeofday(&timecount);

† printk("KERN_ALERT Using pin: %i at %i.%d", gpio, (int)timecount.tv_sec, (int)timecount.tv_usec );

† return IRQ_HANDLED;

}

static int gpio_irq_init(void)

{

† if(gpio == 0){

††† printk("KERN_ALERT Next time, do insmod param gpio=<some pin #>");

††† return 1;

† }

† else{

†††

††† struct timeval timecount;

††† do_gettimeofday(&timecount);

††† printk("KERN_ALERT Using pin: %i at %i.%d", gpio, (int)timecount.tv_sec, (int)timecount.tv_usec );

†††

††† pxa_gpio_mode(gpio | GPIO_IN );

††† set_irq_type(IRQ_GPIO(gpio) , IRQT_FALLING);

††† request_irq(IRQ_GPIO(gpio), my_handler, 0, "my handler", NULL);

†††

††† printk(KERN_ALERT "Hello, world\n");

††† return 0;

† }

}

static void gpio_irq_exit(void)

{

††††††††††† printk(KERN_ALERT "Goodbye, cruel world\n");

††††††††††† free_irq(IRQ_GPIO(gpio), NULL);

}

module_init(gpio_irq_init);

module_exit(gpio_irq_exit);

Brian Gregory