0

Trying to load kernel module on Raspberry Pi 4.

root@raspberrypi:/home/pi# uname -r
5.4.79-v7l+
root@raspberrypi:/home/pi# insmod i2c_rpi4_accel.ko 
insmod: ERROR: could not insert module i2c_rpi4_accel.ko: Unknown symbol in module

Trace:

[   85.132241] i2c_rpi4_accel: Unknown symbol devm_input_allocate_polled_device (err -2)
[   85.132328] i2c_rpi4_accel: Unknown symbol input_register_polled_device (err -2)
[   85.132398] i2c_rpi4_accel: Unknown symbol input_unregister_polled_device (err -2)

Kernel module contains these API calls. How to solve this problem? Probably something in the kernel configuration, but I don't know what parameter exactly to change.

Google search gives 2 links regarding INPUT_POLLDEV configuration parameter, but I don'1 know how to apply it. This is what I have for now in my kernel tree directory:

alex@alex-21:~/linux_rpi4/linux$ cat .config | grep INPUT_POLLDEV
CONFIG_INPUT_POLLDEV=y
Alex F
  • 42,307
  • 41
  • 144
  • 212

1 Answers1

0

Kind of solution: Find file input-polldev.ko in Linux device tree and copy it to the board.

root@raspberrypi:/home/pi# ls
i2c_rpi4_accel.ko  input-polldev.ko
root@raspberrypi:/home/pi# insmod input-polldev.ko
root@raspberrypi:/home/pi# insmod i2c_rpi4_accel.ko 

Looks like after input-polldev my module can be loaded.

Alex F
  • 42,307
  • 41
  • 144
  • 212
  • 1
    Did you look at the wrong .config file in your question? It should have had `CONFIG_INPUT_POLLDEV=m` (not `=y`) if `input-polldev` was built as a module (not built-in). – Ian Abbott Feb 25 '22 at 15:14
  • @IanAbbott: I definitely did something wrong, but I don't understand what exactly. `~/linux_rpi4/linux` is Linux kernel directory where I build the kernel for Raspberry Pi: `alex@alex-u64:~/linux_rpi4/linux$ make -j4 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- zImage modules dtbs` – Alex F Feb 25 '22 at 18:40