I2c devices not getting listed under /dev in openWrt 23.05 kernel version 5.15

We have the below list of i2c devices detected/listed under /dev in centos for the kernel 3.10:

[mcpsecurity@m3-ae0ae9-test ~]$ ls /dev/i2c-
i2c-0   i2c-10  i2c-11  i2c-12  i2c-13  i2c-14  i2c-15  i2c-16  i2c-17  i2c-20  i2c-21  i2c-22  i2c-23  i2c-24  i2c-25  i2c-26  i2c-27
[root@m3-ae0ae9-test ~]$ uname -a
Linux m3-ae0ae9-test 3.10.0-1160.95.1.el7.mcp.x86_64 #2 SMP Thu May 23 11:38:06 EDT 2024 x86_64 x86_64 x86_64 GNU/Linux
[root@m3-ae0ae9-test ~]$

Now we are moving to OpenWrt 23.05 with the same hardware and we can see only the below list under /dev/ for the kernel version 5.15.

root@mcphost:/lib/modules/5.15.137# ls /dev/i2c-
i2c-0  i2c-1  i2c-2  i2c-3  i2c-4  i2c-5
root@mcphost:/lib/modules/5.15.137# uname -a
Linux mcphost 5.15.137 #0 SMP Tue Nov 14 13:38:11 2023 x86_64 GNU/Linux

What are the kernel modules we need to enable related to i2c devices to get listed under /dev ?

Request someone to help on this.

Thanks,
Chinna

Compare dmesg between versions? Maybe driver or dts missing?

When I compared the dmesg I couldn't get the exact driver details. Because in older version we have many such driver modules ported and here in OpenWrt we just started porting the needed drivers one by one. So not sure on which driver module responsible for this. In Openwrt wiki do we have info on what are all the driver modules needed for listing the i2c devices under /dev ?

I'd start with listing ls -d /sys/module/*i2c* really not an expert when it does not show and does not work...

Thanks @brada4 for the info. Below is the list of modules got in 3.10 and 5.15.

# ls /sys/module/*i2c*
/sys/module/i2c_algo_bit:
parameters  uevent

/sys/module/i2c_designware_core:
coresize  holders  initsize  initstate  notes  refcnt  rhelversion  sections  srcversion  taint  uevent

/sys/module/i2c_designware_platform:
coresize  drivers  holders  initsize  initstate  notes  refcnt  rhelversion  sections  srcversion  taint  uevent

/sys/module/i2c_eg20t:
drivers  parameters  uevent

/sys/module/i2c_hid:
coresize  drivers  holders  initsize  initstate  notes  parameters  refcnt  rhelversion  sections  srcversion  taint  uevent

/sys/module/i2c_i801:
drivers  parameters  uevent

/sys/module/i2c_intel_mid:
drivers  parameters  uevent  version

/sys/module/i2c_isch:
parameters  uevent

/sys/module/i2c_ismt:
drivers  parameters  uevent

/sys/module/regmap_i2c:
coresize  holders  initsize  initstate  notes  refcnt  rhelversion  sections  srcversion  taint  uevent

/sys/module/vsat_i2c:
coresize  holders  initsize  initstate  notes  refcnt  rhelversion  sections  srcversion  taint  uevent
/lib/modules/5.15.137# ls /sys/module/*i2c*
/sys/module/i2c_algo_bit:
parameters  uevent

/sys/module/i2c_designware_core:
coresize   holders    initsize   initstate  refcnt     taint      uevent

/sys/module/i2c_designware_pci:
coresize   drivers    holders    initsize   initstate  refcnt     taint      uevent

/sys/module/i2c_dev:
coresize   holders    initsize   initstate  refcnt     taint      uevent

/sys/module/i2c_hid:
parameters  uevent

/sys/module/i2c_smbus:
coresize   drivers    holders    initsize   initstate  refcnt     taint      uevent

/sys/module/vsat_i2c:
coresize   holders    initsize   initstate  refcnt     taint      uevent
root@mcphost:/lib/modules/5.15.137#



Is it lm-sensors related? Run sensors-detect, it will tell what to add, better even on mmidern desktop distro...

No its not related to any of sensors.

Any other info on which kernel module I need to enable in 5.15 linux kernel ?

Try to install all seen in old kernel?

Normally you install kmod-i2c-core, then device-specific packages [for individual peripherals like sensors, RTC, etc.] and, optionally, the tools - i2c-tools