I have a custom PCB with an imaging sensor and a I2C GPIO expander. Both can be probed using i2cget but when I try to implement the devices using the device tree, it’s not working as expected.
As you can see, my TCA9539 is connected to i2c@c240000. This is because it’s physically connected to I2C_GP0, which belongs to i2c-1 according to i2cdetect -l
Am I missing a step in implementing this I2C GPIO expander?
Just in case I’m missing something. I copy the files to the source directory in the L4T build environment and patch the files that need to be patched, then compile the kernel and eventually flash the Jetson using these two commands:
Am I supposed to find any custom related things in here?
Edit:
After doing a search through the whole system looking for “imx392*”, it seems like nothing is found. I believe there might be an issue regarding flashing the kernel. Compiling the kernel does show a result
For the kernel Image you need to copy it to the /boot/Image to apply it.
Did you replace the copy the dtb file to the …/Linux_for_tegra/kernel/dtb/ and flash with -k kernel-dtb?
Did I copy the dtsi files to the wrong location or do I manually have to compile using the devicetree command and copy them to …/Linux_for_Tegra/kernel/dtb/?
Copy ./build/Linux_for_Tegra/images/arch/arm64/boot/dts/tegra186-quill-p3310-1000-c03-00-base.dtb
to ./build/Linux_for_Tegra/kernel/dtb/tegra186-quill-p3310-1000-c03-00-base.dtb
It seems to have done something, but I’m not sure if it’s correct as I can’t test it on my custom carrier board at the moment. Dmesg shows this regarding the TCA9539 and IMX392
[ 0.538232] gpiochip_setup_dev: registered GPIOs 240 to 255 on device: gpiochip2 (tca9539)
[ 0.539190] GPIO line 228 (lcd-bias-rails) hogged as output/high
[ 0.539391] gpiochip_setup_dev: registered GPIOs 224 to 239 on device: gpiochip3 (tca9539)
[ 0.541419] pca953x 1-0074: reg get err: -19
[ 0.543320] i2c i2c-2: of_i2c: modalias failure on /i2c@3180000/lens_imx392@ACDCY1601G1
[ 0.543361] i2c i2c-2: Failed to create I2C device for /i2c@3180000/lens_imx392@ACDCY1601G1
[ 0.543370] i2c i2c-2: of_i2c: modalias failure on /i2c@3180000/lens_imx392@PN1230271
[ 0.543404] i2c i2c-2: Failed to create I2C device for /i2c@3180000/lens_imx392@PN1230271
[ 0.543412] i2c i2c-2: of_i2c: modalias failure on /i2c@3180000/lens_imx392@B5M3428S123
[ 0.543466] i2c i2c-2: Failed to create I2C device for /i2c@3180000/lens_imx392@B5M3428S123
This tells me that the dtb files are flashed. I will test it as soon as I can. (I know that my lens implementations are incorrect, but this is an easy way to generate errors/warnings without breaking compiling of the dtb files)
Unfortunately dmesg doesn’t show any information regarding the TCA9539 at i2c@c240000, and isn’t recognized with i2cdetect. Only after a i2cget command.
What I quite don’t understand is how I should start a video stream so that the TCA9539 will enable the power supplies of the sensors. In the first post you can see that pin 8 is set to a high state, this pin controls the power sequencer chip. However it doesn’t seem to be set to high after a reboot.
Besides that, I don’t see the devnotes of both sensors when I print the /dev directory to my terminal. There’s no video0 and video1.
As you could see the gpio-driver probe shows “reg get err”. Hence the gpio-controller isn’t getting probed. You can add the vcc-supply entry on your gpio-controller device tree node as the driver expects it or you can write a gpio-controller driver derived from drivers/gpio/gpio-pca953x.c and not use devm_regulator_get() on the driver to work with.
Hi Sarath:
There’s no “reg get err” on log,but shows “tegra-i2c c240000.i2c:no acknowledge from address 0x3~0x77”,neither can I i2cdetect or i2cget anything on i2c bus 0~8 which with the lastest BSP(32.3.1),confused about this issue.
When I run this command after boot, the spot on 0x74 is empty (–).
$ sudo i2cdetect -y -r 1
In order to get it shown I have to run this command and then rerun the i2cdetect command.
$ sudo i2cget -y 1 0x74 0x00
@Sarath- I have #vcc-supply = <&en_vdd_cam>; in the TCA9539 part in the device tree file of the imaging sensor. As you can see, it’s disabled. I’m not sure if this part <&en_vdd_cam> is correct. Is this what I should enable/add?