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.

AM1808: GPIO interrupt handler & enabling kgdb

Other Parts Discussed in Thread: OMAP3530

Champs,

Any quick answers from experts ? I haven't researched yet.

Thanks,

Padmaja

 

1. What is the proper way to install an interrupt handler for a GPIO? Why request_irq(46, TestGPIOIrq, IRQF_DISABLED, "TestGPIOTask", NULL); always returns -22 (EINVAL)?

2. What is the correct procedure for enabling kgdb? Why procedure at http://processors.wiki.ti.com/index.php/Debugging_on_DaVinci_using_kgdb does not work?

  • Hi,

    pnimma said:
    1. What is the proper way to install an interrupt handler for a GPIO? Why request_irq(46, TestGPIOIrq, IRQF_DISABLED, "TestGPIOTask", NULL); always returns -22 (EINVAL)?

    Refer to GPIO sample application from the latest PSP release 03.20.00.12.

    Regards, Sudhakar


  • These are the steps to request a gpio and make it an irq pin


    //irq handler

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

    {

    }

     

    driver_init()

    {

    gpio_request(46, gpioname);

     

    gpio_direction_input(46);

     

    result = request_irq(OMAP_GPIO_IRQ(46),

    (void *)&irq_vol,

    IRQF_SHARED,gpio_name,

    (void*)gpio_name);

     

    }

    OMAP_GPIO_IRQ(46) is a macro to convert gpio no to irq number. There must be similar macros for other chips too.

     

    These apis are from omap3530 patched 2.6.32 kernel from ti psp03.00.01.06.

     

    Its been around 1 year that anyone has repied to this link . But I hope someone might find the above info useful.