[PROBLEM]: Error during probing process in inv_icm42600_i2c driver

From: Nikos Latmos
Date: Wed Dec 08 2021 - 09:34:16 EST


Hello,

I have an ARM device based on the Broadcom BCM2837 processor (quad-core
ARM Cortex-A53, 1.2GHz), which has an Invensense ICM-42605 IMU chip
connected over I2C. I'm running an unmodified Linux 5.4.83 kernel. The I2C
driver for my device is in the following path:
drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c.

The problem is that the device driver cannot be probed. More specifically,
dmesg returns the following error message:

inv-icm42600-i2c 0-0068: mounting matrix not found: using identity...
inv-icm42600-i2c 0-0068: 0-0068 supply vdd not found, using dummy regulator
inv-icm42600-i2c 0-0068: 0-0068 supply vddio not found, using dummy regulator
inv-icm42600-i2c: probe of 0-0068 failed with error -121

During the debugging procedure, I found out that the failure occurred when
the driver tried to set up the I2C bus parameters. More precisely, by setting
the INV_ICM42600_REG_INTF_CONFIG6 register according to the values described
in the datasheet for the I2C communication, actually caused the probe function
to fail and return the error -121.

After I experimented with different values in the specific register bits,
I came to the conclusion, that the setting of the bit
INV_ICM42600_INTF_CONFIG6_I3C_SDR_EN caused the system to successfully
probe the driver. Any other bit setting combinations failed to do so.

Any hints on why would the driver behave so?

Here is a patch that I have so far and it seems to solve the issue.

Best regards,
Nick Latmos