Device tree node for I2C ADC driver never gets probed

Hi all,

I have a MAX11612 ADC connected to I2C1 on my Xavier and I am attempting to use the MAX1363 kernel driver with it. I have used this part/driver previously on a different embedded linux system. I can see the I2C device using I2Cdetect, it shows up under bus 1 with address 0x34 as expected. I can send it I2C messages and get responses from it. I rebuilt the l4t kernel with the max1363 driver (max1363.c - drivers/iio/adc/max1363.c - Linux source code (v5.16.1) - Bootlin) as a kernel module and reflashed my board. I now see max1363 when I do an lsmod and under /sys/bus/i2c/drivers/max1363/. I have added the device tree node seen below in the I2C1 node but the probe function never seems to be called on boot or even if I rmmod and insmod the driver. I’ve attached the full decompiled dtb and my dmesg to this post. Is there anything I am doing wrong in setting up the device tree for I2C devices on the Xavier platform?

i2c@c240000 {
	status = "okay";

	max11612@34 {
			compatible = "maxim,max11612";
			reg = <0x34>;
		};
     };

output.dts (240.2 KB)
dmesg_max11612 (61.4 KB)

Dump the device tree from the /proc/device-tree to confirm your DTB was applied.

A way to dump the tree:

# Optional...perhaps you already have "dtc":
sudo apt-get install device-tree-compiler
dtc -I fs -O dts -o extracted.dts /proc/device-tree

I ran the dtc command on the board and got the dts file. It’s not an exact match to the other dts but I still see the max11612 node.
extracted.dts (243.0 KB)

Did you build it as built in module or loadable module?
Any message from dmesg when insmod?

I initially tried building it as a built in module but was having the same issue of it not being probed so I then tried it as a loadable module. It seems to be loaded on boot so I run the following commands

 sudo rmmod max1363
 sudo insmod /lib/modules/4.9.253-tegra/kernel/drivers/iio/adc/max1363.ko

I see no new messages in dmesg

It looks like the driver was failing out in the probe function, specifically on these lines. It looks like the goto’s are removed on newer kernel versions

	st->reg = devm_regulator_get(&client->dev, "vcc");
	if (IS_ERR(st->reg)) {
		ret = PTR_ERR(st->reg);
		goto error_unregister_map;
	}

	ret = regulator_enable(st->reg);
	if (ret)
		goto error_unregister_map;

I commented out the lines and recompiled the module and it worked. This is a bit confusing since vcc-supply is listed as an optional property in the documentation. I have VCC always on for this chip. Does anyone know what I should add to the device tree to have it work with the default driver, I’d rather be running on an unmodified kernel if I can help it.

You need to know the HW design and connect this “vcc” to which regulator than define it in the device tree. If there’s no need you need remove it from the driver.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.