ERROR on gpiod_line_request "device or resource busy" despite being shown as "unused" by gpioinfo

I am using the stock reference minimal (5.4.77-5.2.0+git.297c50e5de78).

I want to use pins SODIMM 101 (gpiochip1 offset=21), and SODIMM 133 (gpiochip1 offset=3))

root@colibri-imx6:~# gpioinfo 1
gpiochip1 - 32 lines:
	line   3: "SODIMM_133"       unused   input  active-high 
	line  21: "SODIMM_101"       unused   input  active-high 

Both lines are shown as ‘unused’. Same for:

root@colibri-imx6:~# cat /sys/kernel/debug/gpio
gpiochip1: GPIOs 32-63, parent: platform/20a0000.gpio, 20a0000.gpio:
 gpio-35  (SODIMM_133          )
 gpio-53  (SODIMM_101          )

I can also use gpioset and gpioget on them.

But when I try to use them via libgpiod I get a “device or resource busy” error:

Here is the setup code:

struct gpiod_line* MCP23017_INTA_line = gpiod_chip_get_line(gpiochip_1, 21);
gpiod_line_request_input(MCP23017_INTA_line, "MCP23017_INTA_line");

if (gpiod_line_request_falling_edge_events(MCP23017_INTA_line, "MCP23017_INTA") !=0){
        perror("gpiod_line_request_falling_edge_events(MCP23017_INTA) failed");

Full test programm source attached . I have also reflashed the image multiple times, no success.

Help or advice which information I should add to this question is very much appreciated.
Thank you!

It is the same for Python3 using python3-gpiod.

In the end it was very trivial.

One must not call “gpiod_line_request_input()” before “gpiod_line_request_X_edge_events()”
Just call the request_event function.

Please close.