Linux i2c not working after CONFIG_MODULES enabled

Linux i2c not working after CONFIG_MODULES enabled
typescript
Ethan Jackson

I have a strange problem. I use an omap evaluation board with linux 6.1. Probing twl4030 companion chip in i2c is OK. But … When i check CONFIG_MODULES (no other modification, all drivers are in builtin (no "=m" in linux/.config)) i2c not working … twl4030 not detected and "i2c deffered probing" … after boot, i2cdetect correctly see the twl4030...

I have Added an msleep(1000) in i2c driver before probe .. not working

Can you help me ?

Thanks

Answer

The problem is caused by the initialization order of drivers in the kernel. When all drivers are built-in (=y), some may start too early — for example, the twl4030 driver tries to initialize before the I2C controller is ready. The kernel then defers the probe, but if no later trigger re-initiates the initialization, the device is not properly detected. In the case of modules (=m), their loading happens later, so the issue does not occur.

Related Articles