Friday, May 26, 2017

kernel - Why an I2C device driver doesn't appear in /sys/bus/i2c/drivers?


Starting from an image ubuntu-18.04.2-preinstalled-server-arm64+raspi3.img.xz (https://wiki.ubuntu.com/ARM/RaspberryPi) I'm trying to add the ad525x_dpot I2C driver which was not enabled during the build of the kernel.


I've taken ad525x_dpot.c, ad525x_dpot.h, ad525x_dpot-i2c.c from the corresponding linux source to make a DKMS package.


dkms.conf:


PACKAGE_NAME="ad525x_dpot"
PACKAGE_VERSION="0.10"
MAKE[0]="make all KVERSION=$kernelver"
CLEAN="make clean"
BUILT_MODULE_NAME[0]="ad525x_dpot"
DEST_MODULE_LOCATION[0]="/kernel/drivers/misc"
AUTOINSTALL="yes"

Makefile:


obj-m := ad525x_dpot.o ad525x_dpot-i2c.o
KVERSION := $(shell uname -r)
all:
$(MAKE) -C /lib/modules/$(KVERSION)/build M=$(PWD) modules
clean:
$(MAKE) -C /lib/modules/$(KVERSION)/build M=$(PWD) clean

The module ad525x_dpot can be loaded by modprobe and it shows in lsmod but not in /sys/bus/i2c/drivers. There are some warnings in syslog.


ad525x_dpot: loading out-of-tree module taints kernel.
ad525x_dpot: module verification failed: signature and/or required key missing - tainting kernel

Why doesn't it show in /sys/bus/i2c/drivers?


I've tried to load a similar kernel module ad799x that comes with the kernel. It appears in /sys/bus/i2c/drivers/ad799x (no devices are defined to use the ad799x, so it's not related to the device tree or the board config).



Had to split ad525x_dpot.o and ad525x_dpot-i2c.o into two DKMS packages to have two separate kernel modules.


1 comment:

  1. Xforce Keygen is a wonderful and lightweight program in the world to activate Coreldraw, and AutoCAD. It allows the users to activate Adobe .
    Keygen X-Force

    ReplyDelete

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...