GPIO character device on Raspberry Pi 3b+

I am building an openwrt image for Raspberry Pi 3B+ and other variants.
I updated to latest 22.0.3 tag and rebuilt my image and now I get an error when accessing GPIOs via libgpiod.
If I run gpiodetect or gpioinfo they don't return any controller.
I see that libgpiod doesn't use the sysfs interface anymore and I don't have /dev/gpiochip0 device.
Running gpiodetect returns and empty list.
But if I check under /sys the controller seem to be recognized:

# ls /sys/class/gpio/
export       gpiochip0    gpiochip504  unexport

In my kernel config I have CONFIG_LIBGPIOD selected.
If I check /proc/devices gpiochip is there:

# cat /proc/devices
Character devices:
  1 mem
254 gpiochip

But if I try to manually create /dev/gpiochip0 using mknod:

# mknod /dev/gpiochip0 c 254 0

then gpiodetect returns an error:

# gpiodetect
gpiodetect: unable to access GPIO chips: No such device or address

The same application/configuration worked with 21.x.
What else should I check to understand what's going wrong with my device?
I haven't changed the dts files and, anyway, if the device is reported under /sys/ I suppose it has been correctly detected and configured.

Isn't mknod enough to create a new device entry for gpio?
Are there some other kernel configs that should be enabled to activate the character device interface for GPIOs?

TY for any help you may provide.

I checked /proc/config.gz and it seems that CONFIG_GPIO_CDEV is not set:

# CONFIG_DEBUG_GPIO is not set
# CONFIG_GPIO_CDEV is not set

I forced this in my config-5.10 file and now it works.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.