This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RE: gpio irq in omap 4460

Hi, I'm having some trouble with irq's on OMAP4460.  My irq handler callback function is not being called when an interrupt is received on my designated GPIO (GPIO 139).  I'm using the Pandaboard with OMAP4460.

My setup procedure in Linux 3.5.0 is the following:

static irqreturn_t irq_handler(int irq, void *dev_id)
{
    printk(KERN_INFO "IRQ HANDLER CALLED\n");
    return IRQ_HANDLED;
}


static  int gpioSetupIrq(int gpio)
{
    int ret;

    ret = gpio_request(gpio, NULL); 
    ret = gpio_direction_input(gpio); 
    ret = gpio_to_irq(gpio);
    irq = ret;

    ret = request_irq(irq, irq_handler, IRQ_TYPE_EDGE_RISING,"test_irq_handler",NULL);
    if (ret)
    {
        printk(KERN_INFO "request_irq failed - irq = %d \n", ret);
    }
}


My code does not crash, but it does not react when I toggle the GPIO pin from external device, I would expect my irq_handler to get called when irq is triggers. I know that GPIO works fine because I'm able to set the GPIO to logic lo and hi with kernel call, gpio_set_value(), etc.Is there some other configuration that I'm missing?


  • Joe,

    I guess this should already be in place if you are able to set the GPIO to low and high, but just to confirm ... Do you have the pin muxing setup correctly in the Pandaboard x-loader for this GPIO?  And this pin is not being set to anything else in the kernel that could overwrite this mux value?

    Regards,
    Gina 

  • Yes, my issue was solved by configuring the pin as input in the pin mux config from uboot, it was set to output. I was thinking that this was being done by gpio_direction_input() Linux API call but apparently that was not the case and I had to set it manually from panda_mux_data.h.  Thx