Clearfog CX LX2 i2c


I am trying to access the ltc3882 sensor on the board via the /sys/class/hwmon interface on linux 5.2.21. I have added the dts file from the patches(lx2160a_build/patches at master · SolidRun/lx2160a_build · GitHub) for lx2160a-cex7 and the kernel compiles without an error.

After compilation I copied the dtb file generated to the /boot/ directory and set it to be used in the boot configuration (extlinux). I also enabled support for i2c and the said sensor in the kernel config options.

The kernel boots but I cannot see any devices listed nor any i2c buses.
How could I solve this?

Those devices are all hung off an i2cswitch so you need to have a driver for the switch and then you can access the different channels. Note that on newer CEX7 modules the ltc3882 is hard wired to read only mode.

Thank you for your reply.

I verified that the i2c and ltc3882 drivers are enabled but it still does not seem to recognize any i2c connections.

Is there any particular driver I should check for? Is there any other factor that may be causing the issue?

but do you have a driver for the i2c switch? NXP’s pca9547 needs a driver to change the channels it is accessing.

Yes, following is from my menuconfig.

  x                                                                                                                                                                                                            x
  x Symbol: I2C_MUX_PCA954x [=y]                                                                                                                                                                               x
  x Type  : tristate                                                                                                                                                                                           x
  x Prompt: NXP PCA954x and PCA984x I2C Mux/switches                                                                                                                                                           x
  x   Location:                                                                                                                                                                                                x
  x     -> Device Drivers                                                                                                                                                                                      x
  x       -> I2C support                                                                                                                                                                                       x
  x         -> I2C support (I2C [=y])                                                                                                                                                                          x
  x           -> I2C bus multiplexing support (I2C_MUX [=y])                                                                                                                                                   x
  x (7)         -> Multiplexer I2C Chip support                                                                                                                                                                x
  x   Defined at drivers/i2c/muxes/Kconfig:67                                                                                                                                                                  x
  x   Depends on: I2C [=y] && I2C_MUX [=y] && (GPIOLIB [=y] || COMPILE_TEST [=n])                    

Then each channel of the switch will be exposed as its own i2c bus. You will need to use the i2c bus device that is enumerated as third device off the mux.

I have enabled all device drivers for the devices on the i2c bus. There is still no bus or device visible under /sys/class/i2c-adapter (or i2c-dev).

The same is detected in another kernel(stock) but not here. The same config options have been enabled in both kernels in regards to I2C, which leads me to believe that the issue may be with the device tree files. However, they compile without issue as well. Checking their content, they also mention required i2c devices.

Is there anything particular I should look for?

I would check the logs to see if the drivers are failing for some reason.

The dmesg log don’t show any messages.

I compiled the drivers as modules and inserted them after booting the system separately as well, they are added successfully but there are no dmesg messages regarding that.

No connections are detected still.

Then most likely you have an issue with the device-tree you are using.

I’m using LX2160ACEX7 and in my case I had to enable these configuration in menuconfig to use LTC3882 component:

  • Go to “Device drivers” then “Hardware Monitoring support”.
    => Include PMBus support.
  • Go to PMBus support and activate:
  • Linear Technologies LTC2978 and compatibles
  • Regulator support for LTC2978 and compatbles
  • Save and exit.

Without these configurations, lm-sensors couldn’t detect the LTC3882 component.
Hope it will help you.