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.19.9) - 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?
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)
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
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.