AnsweredAssumed Answered

problem with i2c-imx driver

Question asked by vincenzo pazienza on Apr 29, 2019
Latest reply on Apr 30, 2019 by igorpadykov

we are working with a i.MX6ULL based board. We are using the debian distribution "Linux imx6ul-var-dart 4.9.88" customized by Variscite which is owner of the module we are using.
We are now making some further customization to use the module in our equipment, and everything worked fine.
On the i2c-3 bus we have 8 IO expander (PCA9555) and we have successfully handled them using the standard i2c driver. But we have then discovered that under particular circumstances due to HW noise one of the IO expander lock the bus, so we need a recovery function.
So we are trying to use the i2c-imx driver that has this functionality but we have problem.
We have configured the kernel in order to have:


and have changed the device tree as it follows:

&i2c3 {
clock-frequency = <400000>;
status = "okay";
pca9555@0x20 {
compatible = "fsl,imx51-i2c", "fsl,imx21-i2c";
//pinctrl-names = "default";
reg = <0x20>;
pinctrl-names = "default", "gpio";
pinctrl-0 = <&pinctrl_i2c3>;
pinctrl-1 = <&pinctrl_i2c3_gpio>;
scl-gpios = <&gpio2 8 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN>;
sda-gpios = <&gpio2 9 GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN>;

pinctrl_i2c3: i2c3grp {
fsl,pins = <
MX6UL_PAD_ENET2_RX_DATA0__I2C3_SCL 0x4001b8b0
MX6UL_PAD_ENET2_RX_DATA1__I2C3_SDA 0x4001b8b0

pinctrl_i2c3_gpio: i2c3grp_gpio {
fsl,pins = <
MX6UL_PAD_ENET2_RX_DATA0__GPIO2_IO08 0x0001b8b0
MX6UL_PAD_ENET2_RX_DATA1__GPIO2_IO09 0x0001b8b0

but the dmesg says:
[ 0.364131] i2c i2c-0: IMX I2C adapter registered
[ 0.364174] i2c i2c-0: can't use DMA, using PIO instead.
[ 0.366389] i2c i2c-1: IMX I2C adapter registered
[ 0.366428] i2c i2c-1: can't use DMA, using PIO instead.
[ 0.366977] imx-i2c 21a8000.i2c: can't get pinctrl, bus recovery not supported
[ 0.367775] i2c i2c-2: IMX I2C adapter registered
[ 0.367809] i2c i2c-2: can't use DMA, using PIO instead.
[ 0.369033] i2c i2c-3: IMX I2C adapter registered
[ 0.369071] i2c i2c-3: can't use DMA, using PIO instead.

So it seems there something wrong but we can't figure out what.

Could anyone please provide us a way to find the problem and how to use correcty the driver?

The complete device tree is in attachment.

Thanks in advance.

Vincenzo Pazienza