LPC3250: how to configure IRQ for GPIO line?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC3250: how to configure IRQ for GPIO line?

146 Views
Shponka
Contributor I

Hi,

I work on a project that uses the LPC3250 board, which is connected to an external chip by a couple of GPIO pins. I need to set up IRQ for some of these lines to trigger an IRQ handler for incoming data.

Initially, this was developed using the 2.6 Linux kernel, and now it is being ported to a more recent 5.15 version. New kernels use the device tree to describe underlying hardware configuration and new GPIO descriptor-based API.

Inside the driver for the device, I try to use the gpiod_get_index() call to get the GPIO descriptor for each GPIO and then gpiod_to_irq() to get the IRQ number. The first call returns a valid descriptor, but the second one returns -EINVAL, like there's no valid IRQ entry. Looking into the Linux kernel GPIO code I can see that there's no GPIO consumer configured.

I'm interested in how to configure IRQ properly on this board. Maybe I need to make some modifications in the device tree file to describe the corresponding IRQ or something similar.

Labels (1)
0 Kudos
0 Replies