0

I'm working on writing a module for the user button on the BeagleBoard-xM Rev C. For now, I'm just trying to print a message when the interrupt handler is called, i.e. when the user button is pressed.

The user button corresponds to GPIO pin 4. I'm performing a gpio_to_irq(4) to obtain the IRQ number which I'm passing to request_irq() with the handler, which is successful. In fact, this is my request_irq call.

irq_res = request_irq(4, interrupt_handler, IRQF_TRIGGER_FALLING, "Interrupt Test", NULL);

And my interrupt handler looks like this.

static irqreturn_t interrupt_handler(int, void*, struct pt_regs*);

But when the button is pressed, the interrupt handler is never called. Any pointers on how to debug this?

Thanks!

Ashwin
  • 873
  • 2
  • 12
  • 21

1 Answers1

0

I wasn't passing 4 to gpio_to_irq. My bad, I was passing the return value of a previous gpiolib function call. I couldn't figure it out, because the variable names were too similar to be caught. I corrected it. And it worked! Thanks!

Ashwin
  • 873
  • 2
  • 12
  • 21